{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "MachineHAck_App_downloads predictions.ipynb",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "code",
      "metadata": {
        "id": "4tFOiAfqzbS9",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 289
        },
        "outputId": "784602d7-4e55-4043-9b39-13aef5d9048f"
      },
      "source": [
        "!wget --header=\"Host: machinehack-be.s3.amazonaws.com\" --header=\"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36\" --header=\"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\" --header=\"Accept-Language: en-US,en;q=0.9\" \"https://machinehack-be.s3.amazonaws.com/playstore_app_downloads_prediction_weekend_hackathon_16/PlayStoreApps-ParticipantsData.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAI2O7AQTB6JBT4VSA%2F20200815%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200815T060003Z&X-Amz-Expires=172800&X-Amz-SignedHeaders=host&X-Amz-Signature=0b430062232370d5c5c5118d189d7a86d90defd79971c1ca3857ceb7ef89bfce\" -c -O 'data.zip'\n",
        "!unzip data.zip"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "--2020-08-16 16:08:56--  https://machinehack-be.s3.amazonaws.com/playstore_app_downloads_prediction_weekend_hackathon_16/PlayStoreApps-ParticipantsData.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAI2O7AQTB6JBT4VSA%2F20200815%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20200815T060003Z&X-Amz-Expires=172800&X-Amz-SignedHeaders=host&X-Amz-Signature=0b430062232370d5c5c5118d189d7a86d90defd79971c1ca3857ceb7ef89bfce\n",
            "Resolving machinehack-be.s3.amazonaws.com (machinehack-be.s3.amazonaws.com)... 52.219.64.56\n",
            "Connecting to machinehack-be.s3.amazonaws.com (machinehack-be.s3.amazonaws.com)|52.219.64.56|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 931277 (909K) [application/zip]\n",
            "Saving to: ‘data.zip’\n",
            "\n",
            "data.zip            100%[===================>] 909.45K   646KB/s    in 1.4s    \n",
            "\n",
            "2020-08-16 16:08:58 (646 KB/s) - ‘data.zip’ saved [931277/931277]\n",
            "\n",
            "Archive:  data.zip\n",
            "  inflating: PlayStoreApps-ParticipantsData/Train.csv  \n",
            "  inflating: PlayStoreApps-ParticipantsData/Test.csv  \n",
            "  inflating: PlayStoreApps-ParticipantsData/Sample_Submission.csv  \n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "r1FuXgMb3UDH",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 591
        },
        "outputId": "ec4c3947-55d6-48cf-8094-163122ca8fae"
      },
      "source": [
        "!pip install catboost"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Collecting category_encoders\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/44/57/fcef41c248701ee62e8325026b90c432adea35555cbc870aff9cfba23727/category_encoders-2.2.2-py2.py3-none-any.whl (80kB)\n",
            "\r\u001b[K     |████                            | 10kB 18.9MB/s eta 0:00:01\r\u001b[K     |████████▏                       | 20kB 4.8MB/s eta 0:00:01\r\u001b[K     |████████████▏                   | 30kB 6.7MB/s eta 0:00:01\r\u001b[K     |████████████████▎               | 40kB 6.5MB/s eta 0:00:01\r\u001b[K     |████████████████████▎           | 51kB 5.4MB/s eta 0:00:01\r\u001b[K     |████████████████████████▍       | 61kB 6.0MB/s eta 0:00:01\r\u001b[K     |████████████████████████████▍   | 71kB 6.4MB/s eta 0:00:01\r\u001b[K     |████████████████████████████████| 81kB 4.4MB/s \n",
            "\u001b[?25hRequirement already satisfied: scipy>=1.0.0 in /usr/local/lib/python3.6/dist-packages (from category_encoders) (1.4.1)\n",
            "Requirement already satisfied: scikit-learn>=0.20.0 in /usr/local/lib/python3.6/dist-packages (from category_encoders) (0.22.2.post1)\n",
            "Requirement already satisfied: pandas>=0.21.1 in /usr/local/lib/python3.6/dist-packages (from category_encoders) (1.0.5)\n",
            "Requirement already satisfied: patsy>=0.5.1 in /usr/local/lib/python3.6/dist-packages (from category_encoders) (0.5.1)\n",
            "Requirement already satisfied: statsmodels>=0.9.0 in /usr/local/lib/python3.6/dist-packages (from category_encoders) (0.10.2)\n",
            "Requirement already satisfied: numpy>=1.14.0 in /usr/local/lib/python3.6/dist-packages (from category_encoders) (1.18.5)\n",
            "Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.6/dist-packages (from scikit-learn>=0.20.0->category_encoders) (0.16.0)\n",
            "Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.21.1->category_encoders) (2018.9)\n",
            "Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.21.1->category_encoders) (2.8.1)\n",
            "Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from patsy>=0.5.1->category_encoders) (1.15.0)\n",
            "Installing collected packages: category-encoders\n",
            "Successfully installed category-encoders-2.2.2\n",
            "Collecting catboost\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/96/6c/6608210b29649267de52001b09e369777ee2a5cfe1c71fa75eba82a4f2dc/catboost-0.24-cp36-none-manylinux1_x86_64.whl (65.9MB)\n",
            "\u001b[K     |████████████████████████████████| 65.9MB 57kB/s \n",
            "\u001b[?25hRequirement already satisfied: graphviz in /usr/local/lib/python3.6/dist-packages (from catboost) (0.10.1)\n",
            "Requirement already satisfied: pandas>=0.24.0 in /usr/local/lib/python3.6/dist-packages (from catboost) (1.0.5)\n",
            "Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from catboost) (1.4.1)\n",
            "Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from catboost) (1.15.0)\n",
            "Requirement already satisfied: plotly in /usr/local/lib/python3.6/dist-packages (from catboost) (4.4.1)\n",
            "Requirement already satisfied: matplotlib in /usr/local/lib/python3.6/dist-packages (from catboost) (3.2.2)\n",
            "Requirement already satisfied: numpy>=1.16.0 in /usr/local/lib/python3.6/dist-packages (from catboost) (1.18.5)\n",
            "Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.24.0->catboost) (2.8.1)\n",
            "Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.24.0->catboost) (2018.9)\n",
            "Requirement already satisfied: retrying>=1.3.3 in /usr/local/lib/python3.6/dist-packages (from plotly->catboost) (1.3.3)\n",
            "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->catboost) (2.4.7)\n",
            "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->catboost) (0.10.0)\n",
            "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->catboost) (1.2.0)\n",
            "Installing collected packages: catboost\n",
            "Successfully installed catboost-0.24\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "LWGBRPsazz38",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import pandas as pd\n",
        "import seaborn as sns\n",
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "from sklearn.preprocessing import LabelEncoder\n",
        "from sklearn.model_selection import KFold,StratifiedKFold\n",
        "from lightgbm import LGBMClassifier\n",
        "from xgboost import XGBClassifier\n",
        "from sklearn.linear_model import LogisticRegression\n",
        "import category_encoders as ce\n",
        "from sklearn.metrics import log_loss\n",
        "import re\n",
        "from imblearn.over_sampling import SMOTE\n",
        "from catboost import CatBoostClassifier\n",
        "import warnings \n",
        "warnings.filterwarnings('ignore')"
      ],
      "execution_count": 4,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "GYziNV5dz8in",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 455
        },
        "outputId": "17e042cc-1a18-44a6-dcf1-5afabcbc3030"
      },
      "source": [
        "train = pd.read_csv(\"PlayStoreApps-ParticipantsData/Train.csv\")\n",
        "test = pd.read_csv(\"PlayStoreApps-ParticipantsData/Test.csv\")\n",
        "train['is_train'] = 1\n",
        "test['is_train'] = 0\n",
        "\n",
        "Target = \"Downloads\"\n",
        "\n",
        "target_encoder = LabelEncoder()\n",
        "train[Target] = target_encoder.fit_transform(train[Target])\n",
        "merge = pd.concat([train,test]).reset_index(drop=True)\n",
        "\n",
        "cols=['Category','Content_Rating']\n",
        "\n",
        "for col in cols:\n",
        "  encoder = LabelEncoder()\n",
        "  merge[col] = encoder.fit_transform(merge[col])\n",
        "  # print(col)\n",
        "\n",
        "merge.Price = merge.Price.apply(lambda x:0 if x ==\"Free\" else float(x))\n",
        "\n",
        "merge['Size in Mb'] = merge.Size.apply(lambda x:1 if x.endswith(\"M\") else 0)\n",
        "merge['Size in Kb'] = merge.Size.apply(lambda x:1 if x.endswith(\"k\") else 0)\n",
        "merge['Size Varies'] = merge.Size.apply(lambda x:1 if x.strip() == 'Varies with device' else 0)\n",
        "merge['Reviews_per_rating'] = merge['Reviews']/merge['Rating']\n",
        "\n",
        "def testing_predictions(model):\n",
        "  testing = test.drop([\"Offered_By\"],axis=1)\n",
        "  predictions = model.predict_proba(testing)\n",
        "  submission = pd.DataFrame(predictions,columns=list(range(18)))\n",
        "  return submission\n",
        "\n",
        "def get(x):\n",
        "  if x == \"Varies with device\":\n",
        "    return 0\n",
        "  else:\n",
        "    x = x.replace(\",\",\"\")\n",
        "    return float(x[:-1])\n",
        "\n",
        "def get_release_version(x):\n",
        "  if x == \"Varies with device\":\n",
        "    return [0]\n",
        "  x = x.split(\".\")\n",
        "  x = [\"\".join(re.findall(\"\\d+\",b)) for b in x]\n",
        "  x = np.array(x).reshape((-1,))\n",
        "  return x\n",
        "\n",
        "def get_base_android_version(x):\n",
        "  if x == \"Varies with device\":\n",
        "    return \"0\"\n",
        "  x = x.split(\"and\")\n",
        "  return x[0].strip()\n",
        "\n",
        "merge.Size = merge.Size.apply(lambda x:get(x))\n",
        "# merge['is_free'] = merge.apply(lambda x:1 if x['Size'] == 0 else 0,axis=1)\n",
        "merge.Last_Updated_On = pd.to_datetime(merge.Last_Updated_On)\n",
        "\n",
        "merge.drop([\"Release_Version\"],axis=1,inplace=True)\n",
        "merge.OS_Version_Required = merge.OS_Version_Required.apply(lambda x:get_base_android_version(x))\n",
        "encoder = LabelEncoder()\n",
        "merge.OS_Version_Required = encoder.fit_transform(merge.OS_Version_Required)\n",
        "\n",
        "merge['Last_Updated_On_month'] = merge.Last_Updated_On.dt.month\n",
        "merge['Last_Updated_On_year'] = merge.Last_Updated_On.dt.year\n",
        "merge['Last_Updated_On_day'] = merge.Last_Updated_On.dt.day\n",
        "merge['Last_Updated_On_quarter'] = merge.Last_Updated_On.dt.quarter\n",
        "merge['Last_Updated_On_week'] = merge.Last_Updated_On.dt.week\n",
        "\n",
        "merge.drop('Last_Updated_On',axis=1,inplace=True)\n",
        "\n",
        "for col in ['Category',\"Offered_By\",'OS_Version_Required',\"Content_Rating\"]:\n",
        "  m = merge.groupby([col])['Reviews','Size',\"Price\",\"Rating\"].agg(['min',\"max\",\"mean\",\"sum\"]).reset_index()\n",
        "  cols = []\n",
        "  for i in m.columns:\n",
        "    if i[1]==\"\":\n",
        "      cols.append(i[0])\n",
        "    else:\n",
        "      cols.append(f\"{col}_\"+\"_\".join(i))\n",
        "  m.columns = cols\n",
        "  merge = pd.merge(merge,m,on=[col],how=\"left\")\n",
        "\n",
        "for col in ['Offered_By','Category','Content_Rating','OS_Version_Required']:\n",
        "  m = merge.groupby([col])[col].agg(['count']).reset_index()\n",
        "  cols = []\n",
        "  m.columns = [col,f\"{col}_unique_count\"]\n",
        "  merge = pd.merge(merge,m,on=[col],how=\"left\")\n",
        "\n",
        "for col in ['Content_Rating','OS_Version_Required']:\n",
        "  m = pd.DataFrame(merge.groupby([col])['Category'].nunique()).reset_index().rename(columns={'Category':f\"{col}_Category_nunique\"})\n",
        "  merge = pd.merge(merge,m,on=col,how=\"left\")\n",
        "\n",
        "for col in ['Category','OS_Version_Required']:\n",
        "  m = pd.DataFrame(merge.groupby([col])['Content_Rating'].nunique()).reset_index().rename(columns={'Content_Rating':f\"{col}_Rating_nunique\"})\n",
        "  merge = pd.merge(merge,m,on=col,how='left')\n",
        "\n",
        "for col in ['Category','Content_Rating']:\n",
        "  m= pd.DataFrame(merge.groupby([col])['OS_Version_Required'].nunique()).reset_index().rename(columns={'OS_Version_Required':f'{col}_OS_Version_Required_count'})\n",
        "  merge = pd.merge(merge,m , on=col,how=\"left\")\n",
        "\n",
        "for col in ['Rating',\"Reviews\",'Price','Size']:\n",
        "  m = pd.DataFrame(merge.groupby(['Category','Content_Rating'])[col].agg(['mean','count','sum'])).reset_index()\n",
        "  m = m.rename(columns = {'mean':f\"Category_Content_Rating_{col}_mean\",\n",
        "                          'sum':f\"Category_Content_Rating_{col}_sum\",\n",
        "                          'count':f\"Category_Content_Rating_{col}_count\"})\n",
        "\n",
        "  merge = pd.merge(merge,m,on=['Category','Content_Rating'],how=\"left\")\n",
        "\n",
        "########################################################################\n",
        "\n",
        "# for col in ['Rating',\"Reviews\",'Price','Size']:\n",
        "#   m = pd.DataFrame(merge.groupby(['Content_Rating','OS_Version_Required'])[col].agg(['mean','count','sum'])).reset_index()\n",
        "#   m = m.rename(columns = {'mean':f\"Content_Rating_OS_Version_Required_{col}_mean\",\n",
        "#                           'sum':f\"Content_Rating_OS_Version_Required_{col}_sum\",\n",
        "#                           'count':f\"Content_Rating_OS_Version_Required_{col}_count\"})\n",
        "\n",
        "#   merge = pd.merge(merge,m,on=['Content_Rating','OS_Version_Required'],how=\"left\")\n",
        "\n",
        "\n",
        "record = merge[merge[Target] == 11]\n",
        "\n",
        "train = merge[merge.is_train == 1]\n",
        "train[Target] = train[Target].apply(lambda x:int(x))\n",
        "train.drop(\"is_train\",inplace=True,axis=1)\n",
        "train = train.reset_index(drop=True)\n",
        "# .drop_duplicates()\n",
        "\n",
        "test = merge[merge.is_train == 0]\n",
        "test.drop([Target,'is_train'],axis=1,inplace=True)\n",
        "train"
      ],
      "execution_count": 40,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Offered_By</th>\n",
              "      <th>Category</th>\n",
              "      <th>Rating</th>\n",
              "      <th>Reviews</th>\n",
              "      <th>Size</th>\n",
              "      <th>Price</th>\n",
              "      <th>Content_Rating</th>\n",
              "      <th>OS_Version_Required</th>\n",
              "      <th>Downloads</th>\n",
              "      <th>Size in Mb</th>\n",
              "      <th>Size in Kb</th>\n",
              "      <th>Size Varies</th>\n",
              "      <th>Reviews_per_rating</th>\n",
              "      <th>Last_Updated_On_month</th>\n",
              "      <th>Last_Updated_On_year</th>\n",
              "      <th>Last_Updated_On_day</th>\n",
              "      <th>Last_Updated_On_quarter</th>\n",
              "      <th>Last_Updated_On_week</th>\n",
              "      <th>Category_Reviews_min</th>\n",
              "      <th>Category_Reviews_max</th>\n",
              "      <th>Category_Reviews_mean</th>\n",
              "      <th>Category_Reviews_sum</th>\n",
              "      <th>Category_Size_min</th>\n",
              "      <th>Category_Size_max</th>\n",
              "      <th>Category_Size_mean</th>\n",
              "      <th>Category_Size_sum</th>\n",
              "      <th>Category_Price_min</th>\n",
              "      <th>Category_Price_max</th>\n",
              "      <th>Category_Price_mean</th>\n",
              "      <th>Category_Price_sum</th>\n",
              "      <th>Category_Rating_min</th>\n",
              "      <th>Category_Rating_max</th>\n",
              "      <th>Category_Rating_mean</th>\n",
              "      <th>Category_Rating_sum</th>\n",
              "      <th>Offered_By_Reviews_min</th>\n",
              "      <th>Offered_By_Reviews_max</th>\n",
              "      <th>Offered_By_Reviews_mean</th>\n",
              "      <th>Offered_By_Reviews_sum</th>\n",
              "      <th>Offered_By_Size_min</th>\n",
              "      <th>Offered_By_Size_max</th>\n",
              "      <th>...</th>\n",
              "      <th>OS_Version_Required_Rating_mean</th>\n",
              "      <th>OS_Version_Required_Rating_sum</th>\n",
              "      <th>Content_Rating_Reviews_min</th>\n",
              "      <th>Content_Rating_Reviews_max</th>\n",
              "      <th>Content_Rating_Reviews_mean</th>\n",
              "      <th>Content_Rating_Reviews_sum</th>\n",
              "      <th>Content_Rating_Size_min</th>\n",
              "      <th>Content_Rating_Size_max</th>\n",
              "      <th>Content_Rating_Size_mean</th>\n",
              "      <th>Content_Rating_Size_sum</th>\n",
              "      <th>Content_Rating_Price_min</th>\n",
              "      <th>Content_Rating_Price_max</th>\n",
              "      <th>Content_Rating_Price_mean</th>\n",
              "      <th>Content_Rating_Price_sum</th>\n",
              "      <th>Content_Rating_Rating_min</th>\n",
              "      <th>Content_Rating_Rating_max</th>\n",
              "      <th>Content_Rating_Rating_mean</th>\n",
              "      <th>Content_Rating_Rating_sum</th>\n",
              "      <th>Offered_By_unique_count</th>\n",
              "      <th>Category_unique_count</th>\n",
              "      <th>Content_Rating_unique_count</th>\n",
              "      <th>OS_Version_Required_unique_count</th>\n",
              "      <th>Content_Rating_Category_nunique</th>\n",
              "      <th>OS_Version_Required_Category_nunique</th>\n",
              "      <th>Category_Rating_nunique</th>\n",
              "      <th>OS_Version_Required_Rating_nunique</th>\n",
              "      <th>Category_OS_Version_Required_count</th>\n",
              "      <th>Content_Rating_OS_Version_Required_count</th>\n",
              "      <th>Category_Content_Rating_Rating_mean</th>\n",
              "      <th>Category_Content_Rating_Rating_count</th>\n",
              "      <th>Category_Content_Rating_Rating_sum</th>\n",
              "      <th>Category_Content_Rating_Reviews_mean</th>\n",
              "      <th>Category_Content_Rating_Reviews_count</th>\n",
              "      <th>Category_Content_Rating_Reviews_sum</th>\n",
              "      <th>Category_Content_Rating_Price_mean</th>\n",
              "      <th>Category_Content_Rating_Price_count</th>\n",
              "      <th>Category_Content_Rating_Price_sum</th>\n",
              "      <th>Category_Content_Rating_Size_mean</th>\n",
              "      <th>Category_Content_Rating_Size_count</th>\n",
              "      <th>Category_Content_Rating_Size_sum</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>ps_id-24654</td>\n",
              "      <td>12</td>\n",
              "      <td>4.18</td>\n",
              "      <td>1481</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>7</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>354.306220</td>\n",
              "      <td>5</td>\n",
              "      <td>2020</td>\n",
              "      <td>5</td>\n",
              "      <td>2</td>\n",
              "      <td>19</td>\n",
              "      <td>1</td>\n",
              "      <td>3230511</td>\n",
              "      <td>38009.799644</td>\n",
              "      <td>64122532</td>\n",
              "      <td>0.0</td>\n",
              "      <td>965.0</td>\n",
              "      <td>22.270954</td>\n",
              "      <td>37571.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29831.2542</td>\n",
              "      <td>115.074243</td>\n",
              "      <td>194130.2484</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.039905</td>\n",
              "      <td>6815.32</td>\n",
              "      <td>1481</td>\n",
              "      <td>1481</td>\n",
              "      <td>1481.0</td>\n",
              "      <td>1481</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.265055</td>\n",
              "      <td>15533.33</td>\n",
              "      <td>1</td>\n",
              "      <td>86214292</td>\n",
              "      <td>136972.450560</td>\n",
              "      <td>4768011004</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>27.045478</td>\n",
              "      <td>941453.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29832.0000</td>\n",
              "      <td>32.982100</td>\n",
              "      <td>1.148107e+06</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.249978</td>\n",
              "      <td>147941.75</td>\n",
              "      <td>1</td>\n",
              "      <td>1687</td>\n",
              "      <td>34810</td>\n",
              "      <td>3642</td>\n",
              "      <td>51</td>\n",
              "      <td>51</td>\n",
              "      <td>4</td>\n",
              "      <td>5</td>\n",
              "      <td>21</td>\n",
              "      <td>36</td>\n",
              "      <td>4.039713</td>\n",
              "      <td>1674</td>\n",
              "      <td>6762.48</td>\n",
              "      <td>38210.903823</td>\n",
              "      <td>1674</td>\n",
              "      <td>63965053</td>\n",
              "      <td>98.147547</td>\n",
              "      <td>1674</td>\n",
              "      <td>164298.9942</td>\n",
              "      <td>22.279271</td>\n",
              "      <td>1674</td>\n",
              "      <td>37295.5</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>ps_id-35329</td>\n",
              "      <td>38</td>\n",
              "      <td>4.81</td>\n",
              "      <td>302</td>\n",
              "      <td>10.0</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>1</td>\n",
              "      <td>20</td>\n",
              "      <td>9</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>62.785863</td>\n",
              "      <td>3</td>\n",
              "      <td>2020</td>\n",
              "      <td>26</td>\n",
              "      <td>1</td>\n",
              "      <td>13</td>\n",
              "      <td>1</td>\n",
              "      <td>14642083</td>\n",
              "      <td>65086.675857</td>\n",
              "      <td>87346319</td>\n",
              "      <td>0.0</td>\n",
              "      <td>904.0</td>\n",
              "      <td>24.448361</td>\n",
              "      <td>32809.7</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1789.1742</td>\n",
              "      <td>16.090274</td>\n",
              "      <td>21593.1474</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.396177</td>\n",
              "      <td>5899.67</td>\n",
              "      <td>302</td>\n",
              "      <td>302</td>\n",
              "      <td>302.0</td>\n",
              "      <td>302</td>\n",
              "      <td>10.0</td>\n",
              "      <td>10.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.307285</td>\n",
              "      <td>45248.03</td>\n",
              "      <td>1</td>\n",
              "      <td>86214292</td>\n",
              "      <td>136972.450560</td>\n",
              "      <td>4768011004</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>27.045478</td>\n",
              "      <td>941453.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29832.0000</td>\n",
              "      <td>32.982100</td>\n",
              "      <td>1.148107e+06</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.249978</td>\n",
              "      <td>147941.75</td>\n",
              "      <td>1</td>\n",
              "      <td>1342</td>\n",
              "      <td>34810</td>\n",
              "      <td>10505</td>\n",
              "      <td>51</td>\n",
              "      <td>51</td>\n",
              "      <td>4</td>\n",
              "      <td>5</td>\n",
              "      <td>21</td>\n",
              "      <td>36</td>\n",
              "      <td>4.406980</td>\n",
              "      <td>1063</td>\n",
              "      <td>4684.62</td>\n",
              "      <td>30521.520226</td>\n",
              "      <td>1063</td>\n",
              "      <td>32444376</td>\n",
              "      <td>18.247895</td>\n",
              "      <td>1063</td>\n",
              "      <td>19397.5122</td>\n",
              "      <td>25.332361</td>\n",
              "      <td>1063</td>\n",
              "      <td>26928.3</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>ps_id-11044</td>\n",
              "      <td>21</td>\n",
              "      <td>4.27</td>\n",
              "      <td>374</td>\n",
              "      <td>27.0</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>1</td>\n",
              "      <td>20</td>\n",
              "      <td>4</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>87.587822</td>\n",
              "      <td>5</td>\n",
              "      <td>2020</td>\n",
              "      <td>1</td>\n",
              "      <td>2</td>\n",
              "      <td>18</td>\n",
              "      <td>1</td>\n",
              "      <td>24657922</td>\n",
              "      <td>272360.050919</td>\n",
              "      <td>192558556</td>\n",
              "      <td>0.0</td>\n",
              "      <td>776.0</td>\n",
              "      <td>35.630410</td>\n",
              "      <td>25190.7</td>\n",
              "      <td>0.0</td>\n",
              "      <td>372.9000</td>\n",
              "      <td>19.137629</td>\n",
              "      <td>13530.3036</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.287723</td>\n",
              "      <td>3031.42</td>\n",
              "      <td>374</td>\n",
              "      <td>374</td>\n",
              "      <td>374.0</td>\n",
              "      <td>374</td>\n",
              "      <td>27.0</td>\n",
              "      <td>27.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.307285</td>\n",
              "      <td>45248.03</td>\n",
              "      <td>1</td>\n",
              "      <td>86214292</td>\n",
              "      <td>136972.450560</td>\n",
              "      <td>4768011004</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>27.045478</td>\n",
              "      <td>941453.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29832.0000</td>\n",
              "      <td>32.982100</td>\n",
              "      <td>1.148107e+06</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.249978</td>\n",
              "      <td>147941.75</td>\n",
              "      <td>1</td>\n",
              "      <td>707</td>\n",
              "      <td>34810</td>\n",
              "      <td>10505</td>\n",
              "      <td>51</td>\n",
              "      <td>51</td>\n",
              "      <td>5</td>\n",
              "      <td>5</td>\n",
              "      <td>18</td>\n",
              "      <td>36</td>\n",
              "      <td>4.278449</td>\n",
              "      <td>632</td>\n",
              "      <td>2703.98</td>\n",
              "      <td>262232.734177</td>\n",
              "      <td>632</td>\n",
              "      <td>165731088</td>\n",
              "      <td>20.234545</td>\n",
              "      <td>632</td>\n",
              "      <td>12788.2326</td>\n",
              "      <td>34.225158</td>\n",
              "      <td>632</td>\n",
              "      <td>21630.3</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>ps_id-36068</td>\n",
              "      <td>4</td>\n",
              "      <td>4.03</td>\n",
              "      <td>122058</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>4</td>\n",
              "      <td>0</td>\n",
              "      <td>5</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>30287.344913</td>\n",
              "      <td>5</td>\n",
              "      <td>2020</td>\n",
              "      <td>2</td>\n",
              "      <td>2</td>\n",
              "      <td>18</td>\n",
              "      <td>1</td>\n",
              "      <td>1650169</td>\n",
              "      <td>23309.292389</td>\n",
              "      <td>30931431</td>\n",
              "      <td>0.0</td>\n",
              "      <td>976.0</td>\n",
              "      <td>19.550565</td>\n",
              "      <td>25943.6</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1341.6942</td>\n",
              "      <td>11.180818</td>\n",
              "      <td>14836.9452</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.072999</td>\n",
              "      <td>5404.87</td>\n",
              "      <td>122058</td>\n",
              "      <td>122058</td>\n",
              "      <td>122058.0</td>\n",
              "      <td>122058</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.265055</td>\n",
              "      <td>15533.33</td>\n",
              "      <td>1</td>\n",
              "      <td>85766433</td>\n",
              "      <td>485253.210606</td>\n",
              "      <td>1912382903</td>\n",
              "      <td>0.0</td>\n",
              "      <td>924.0</td>\n",
              "      <td>29.660467</td>\n",
              "      <td>116891.9</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29831.2542</td>\n",
              "      <td>28.021718</td>\n",
              "      <td>1.104336e+05</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.286184</td>\n",
              "      <td>16891.85</td>\n",
              "      <td>1</td>\n",
              "      <td>1327</td>\n",
              "      <td>3941</td>\n",
              "      <td>3642</td>\n",
              "      <td>50</td>\n",
              "      <td>51</td>\n",
              "      <td>3</td>\n",
              "      <td>5</td>\n",
              "      <td>21</td>\n",
              "      <td>25</td>\n",
              "      <td>4.361111</td>\n",
              "      <td>27</td>\n",
              "      <td>117.75</td>\n",
              "      <td>5995.962963</td>\n",
              "      <td>27</td>\n",
              "      <td>161891</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>27</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>18.440741</td>\n",
              "      <td>27</td>\n",
              "      <td>497.9</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>ps_id-35831</td>\n",
              "      <td>37</td>\n",
              "      <td>4.60</td>\n",
              "      <td>358</td>\n",
              "      <td>0.0</td>\n",
              "      <td>297.5742</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>9</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>77.826087</td>\n",
              "      <td>11</td>\n",
              "      <td>2018</td>\n",
              "      <td>29</td>\n",
              "      <td>4</td>\n",
              "      <td>48</td>\n",
              "      <td>1</td>\n",
              "      <td>156410</td>\n",
              "      <td>4540.989273</td>\n",
              "      <td>3809890</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>36.830393</td>\n",
              "      <td>30900.7</td>\n",
              "      <td>0.0</td>\n",
              "      <td>7457.2542</td>\n",
              "      <td>179.103114</td>\n",
              "      <td>150267.5130</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.217318</td>\n",
              "      <td>3538.33</td>\n",
              "      <td>358</td>\n",
              "      <td>358</td>\n",
              "      <td>358.0</td>\n",
              "      <td>358</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.265055</td>\n",
              "      <td>15533.33</td>\n",
              "      <td>1</td>\n",
              "      <td>86214292</td>\n",
              "      <td>136972.450560</td>\n",
              "      <td>4768011004</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>27.045478</td>\n",
              "      <td>941453.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29832.0000</td>\n",
              "      <td>32.982100</td>\n",
              "      <td>1.148107e+06</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.249978</td>\n",
              "      <td>147941.75</td>\n",
              "      <td>1</td>\n",
              "      <td>839</td>\n",
              "      <td>34810</td>\n",
              "      <td>3642</td>\n",
              "      <td>51</td>\n",
              "      <td>51</td>\n",
              "      <td>4</td>\n",
              "      <td>5</td>\n",
              "      <td>21</td>\n",
              "      <td>36</td>\n",
              "      <td>4.206383</td>\n",
              "      <td>788</td>\n",
              "      <td>3314.63</td>\n",
              "      <td>4606.119289</td>\n",
              "      <td>788</td>\n",
              "      <td>3629622</td>\n",
              "      <td>182.277116</td>\n",
              "      <td>788</td>\n",
              "      <td>143634.3678</td>\n",
              "      <td>36.860787</td>\n",
              "      <td>788</td>\n",
              "      <td>29046.3</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16511</th>\n",
              "      <td>ps_id-5583</td>\n",
              "      <td>32</td>\n",
              "      <td>4.30</td>\n",
              "      <td>13724</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>3191.627907</td>\n",
              "      <td>9</td>\n",
              "      <td>2018</td>\n",
              "      <td>21</td>\n",
              "      <td>3</td>\n",
              "      <td>38</td>\n",
              "      <td>1</td>\n",
              "      <td>4824180</td>\n",
              "      <td>63463.955373</td>\n",
              "      <td>69683423</td>\n",
              "      <td>0.0</td>\n",
              "      <td>949.0</td>\n",
              "      <td>22.341257</td>\n",
              "      <td>24530.7</td>\n",
              "      <td>0.0</td>\n",
              "      <td>595.8942</td>\n",
              "      <td>13.836016</td>\n",
              "      <td>15191.9460</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.258789</td>\n",
              "      <td>4676.15</td>\n",
              "      <td>13724</td>\n",
              "      <td>13724</td>\n",
              "      <td>13724.0</td>\n",
              "      <td>13724</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.265055</td>\n",
              "      <td>15533.33</td>\n",
              "      <td>1</td>\n",
              "      <td>86214292</td>\n",
              "      <td>136972.450560</td>\n",
              "      <td>4768011004</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>27.045478</td>\n",
              "      <td>941453.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29832.0000</td>\n",
              "      <td>32.982100</td>\n",
              "      <td>1.148107e+06</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.249978</td>\n",
              "      <td>147941.75</td>\n",
              "      <td>1</td>\n",
              "      <td>1098</td>\n",
              "      <td>34810</td>\n",
              "      <td>3642</td>\n",
              "      <td>51</td>\n",
              "      <td>51</td>\n",
              "      <td>4</td>\n",
              "      <td>5</td>\n",
              "      <td>22</td>\n",
              "      <td>36</td>\n",
              "      <td>4.255609</td>\n",
              "      <td>1034</td>\n",
              "      <td>4400.30</td>\n",
              "      <td>65231.386847</td>\n",
              "      <td>1034</td>\n",
              "      <td>67449254</td>\n",
              "      <td>14.692404</td>\n",
              "      <td>1034</td>\n",
              "      <td>15191.9460</td>\n",
              "      <td>22.412959</td>\n",
              "      <td>1034</td>\n",
              "      <td>23175.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16512</th>\n",
              "      <td>ps_id-15485</td>\n",
              "      <td>2</td>\n",
              "      <td>4.73</td>\n",
              "      <td>70</td>\n",
              "      <td>7.9</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>1</td>\n",
              "      <td>20</td>\n",
              "      <td>4</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>14.799154</td>\n",
              "      <td>5</td>\n",
              "      <td>2020</td>\n",
              "      <td>7</td>\n",
              "      <td>2</td>\n",
              "      <td>19</td>\n",
              "      <td>1</td>\n",
              "      <td>123183</td>\n",
              "      <td>7834.954545</td>\n",
              "      <td>1034214</td>\n",
              "      <td>0.0</td>\n",
              "      <td>82.0</td>\n",
              "      <td>16.234091</td>\n",
              "      <td>2142.9</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.247879</td>\n",
              "      <td>560.72</td>\n",
              "      <td>70</td>\n",
              "      <td>70</td>\n",
              "      <td>70.0</td>\n",
              "      <td>70</td>\n",
              "      <td>7.9</td>\n",
              "      <td>7.9</td>\n",
              "      <td>...</td>\n",
              "      <td>4.307285</td>\n",
              "      <td>45248.03</td>\n",
              "      <td>1</td>\n",
              "      <td>86214292</td>\n",
              "      <td>136972.450560</td>\n",
              "      <td>4768011004</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>27.045478</td>\n",
              "      <td>941453.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29832.0000</td>\n",
              "      <td>32.982100</td>\n",
              "      <td>1.148107e+06</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.249978</td>\n",
              "      <td>147941.75</td>\n",
              "      <td>1</td>\n",
              "      <td>132</td>\n",
              "      <td>34810</td>\n",
              "      <td>10505</td>\n",
              "      <td>51</td>\n",
              "      <td>51</td>\n",
              "      <td>4</td>\n",
              "      <td>5</td>\n",
              "      <td>14</td>\n",
              "      <td>36</td>\n",
              "      <td>4.242627</td>\n",
              "      <td>118</td>\n",
              "      <td>500.63</td>\n",
              "      <td>8528.855932</td>\n",
              "      <td>118</td>\n",
              "      <td>1006405</td>\n",
              "      <td>0.000000</td>\n",
              "      <td>118</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>14.886441</td>\n",
              "      <td>118</td>\n",
              "      <td>1756.6</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16513</th>\n",
              "      <td>ps_id-36065</td>\n",
              "      <td>32</td>\n",
              "      <td>4.60</td>\n",
              "      <td>5420</td>\n",
              "      <td>21.0</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>1</td>\n",
              "      <td>20</td>\n",
              "      <td>16</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1178.260870</td>\n",
              "      <td>7</td>\n",
              "      <td>2019</td>\n",
              "      <td>10</td>\n",
              "      <td>3</td>\n",
              "      <td>28</td>\n",
              "      <td>1</td>\n",
              "      <td>4824180</td>\n",
              "      <td>63463.955373</td>\n",
              "      <td>69683423</td>\n",
              "      <td>0.0</td>\n",
              "      <td>949.0</td>\n",
              "      <td>22.341257</td>\n",
              "      <td>24530.7</td>\n",
              "      <td>0.0</td>\n",
              "      <td>595.8942</td>\n",
              "      <td>13.836016</td>\n",
              "      <td>15191.9460</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.258789</td>\n",
              "      <td>4676.15</td>\n",
              "      <td>5420</td>\n",
              "      <td>5823</td>\n",
              "      <td>5621.5</td>\n",
              "      <td>11243</td>\n",
              "      <td>21.0</td>\n",
              "      <td>21.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.307285</td>\n",
              "      <td>45248.03</td>\n",
              "      <td>1</td>\n",
              "      <td>86214292</td>\n",
              "      <td>136972.450560</td>\n",
              "      <td>4768011004</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>27.045478</td>\n",
              "      <td>941453.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29832.0000</td>\n",
              "      <td>32.982100</td>\n",
              "      <td>1.148107e+06</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.249978</td>\n",
              "      <td>147941.75</td>\n",
              "      <td>2</td>\n",
              "      <td>1098</td>\n",
              "      <td>34810</td>\n",
              "      <td>10505</td>\n",
              "      <td>51</td>\n",
              "      <td>51</td>\n",
              "      <td>4</td>\n",
              "      <td>5</td>\n",
              "      <td>22</td>\n",
              "      <td>36</td>\n",
              "      <td>4.255609</td>\n",
              "      <td>1034</td>\n",
              "      <td>4400.30</td>\n",
              "      <td>65231.386847</td>\n",
              "      <td>1034</td>\n",
              "      <td>67449254</td>\n",
              "      <td>14.692404</td>\n",
              "      <td>1034</td>\n",
              "      <td>15191.9460</td>\n",
              "      <td>22.412959</td>\n",
              "      <td>1034</td>\n",
              "      <td>23175.0</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16514</th>\n",
              "      <td>ps_id-12625</td>\n",
              "      <td>43</td>\n",
              "      <td>4.60</td>\n",
              "      <td>1488289</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0000</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>8</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>323541.086957</td>\n",
              "      <td>9</td>\n",
              "      <td>2019</td>\n",
              "      <td>7</td>\n",
              "      <td>3</td>\n",
              "      <td>36</td>\n",
              "      <td>1</td>\n",
              "      <td>9123436</td>\n",
              "      <td>136514.481557</td>\n",
              "      <td>199857201</td>\n",
              "      <td>0.0</td>\n",
              "      <td>998.0</td>\n",
              "      <td>32.882787</td>\n",
              "      <td>48140.4</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1490.8542</td>\n",
              "      <td>20.203844</td>\n",
              "      <td>29578.4280</td>\n",
              "      <td>1.00</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.231851</td>\n",
              "      <td>6195.43</td>\n",
              "      <td>1488289</td>\n",
              "      <td>1488397</td>\n",
              "      <td>1488369.5</td>\n",
              "      <td>5953478</td>\n",
              "      <td>0.0</td>\n",
              "      <td>0.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.265055</td>\n",
              "      <td>15533.33</td>\n",
              "      <td>1</td>\n",
              "      <td>86214292</td>\n",
              "      <td>136972.450560</td>\n",
              "      <td>4768011004</td>\n",
              "      <td>0.0</td>\n",
              "      <td>1024.0</td>\n",
              "      <td>27.045478</td>\n",
              "      <td>941453.1</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29832.0000</td>\n",
              "      <td>32.982100</td>\n",
              "      <td>1.148107e+06</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.249978</td>\n",
              "      <td>147941.75</td>\n",
              "      <td>4</td>\n",
              "      <td>1464</td>\n",
              "      <td>34810</td>\n",
              "      <td>3642</td>\n",
              "      <td>51</td>\n",
              "      <td>51</td>\n",
              "      <td>4</td>\n",
              "      <td>5</td>\n",
              "      <td>24</td>\n",
              "      <td>36</td>\n",
              "      <td>4.231036</td>\n",
              "      <td>1438</td>\n",
              "      <td>6084.23</td>\n",
              "      <td>137723.142559</td>\n",
              "      <td>1438</td>\n",
              "      <td>198045879</td>\n",
              "      <td>19.830604</td>\n",
              "      <td>1438</td>\n",
              "      <td>28516.4088</td>\n",
              "      <td>31.286370</td>\n",
              "      <td>1438</td>\n",
              "      <td>44989.8</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16515</th>\n",
              "      <td>ps_id-4549</td>\n",
              "      <td>26</td>\n",
              "      <td>4.45</td>\n",
              "      <td>21201</td>\n",
              "      <td>16.0</td>\n",
              "      <td>745.0542</td>\n",
              "      <td>4</td>\n",
              "      <td>13</td>\n",
              "      <td>7</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>4764.269663</td>\n",
              "      <td>9</td>\n",
              "      <td>2019</td>\n",
              "      <td>20</td>\n",
              "      <td>3</td>\n",
              "      <td>38</td>\n",
              "      <td>1</td>\n",
              "      <td>2649608</td>\n",
              "      <td>119910.743468</td>\n",
              "      <td>50482423</td>\n",
              "      <td>0.0</td>\n",
              "      <td>608.0</td>\n",
              "      <td>48.542043</td>\n",
              "      <td>20436.2</td>\n",
              "      <td>0.0</td>\n",
              "      <td>2236.6542</td>\n",
              "      <td>92.622691</td>\n",
              "      <td>38994.1530</td>\n",
              "      <td>2.73</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.372518</td>\n",
              "      <td>1840.83</td>\n",
              "      <td>20101</td>\n",
              "      <td>21201</td>\n",
              "      <td>20651.0</td>\n",
              "      <td>41302</td>\n",
              "      <td>7.8</td>\n",
              "      <td>16.0</td>\n",
              "      <td>...</td>\n",
              "      <td>4.164247</td>\n",
              "      <td>2461.07</td>\n",
              "      <td>1</td>\n",
              "      <td>85766433</td>\n",
              "      <td>485253.210606</td>\n",
              "      <td>1912382903</td>\n",
              "      <td>0.0</td>\n",
              "      <td>924.0</td>\n",
              "      <td>29.660467</td>\n",
              "      <td>116891.9</td>\n",
              "      <td>0.0</td>\n",
              "      <td>29831.2542</td>\n",
              "      <td>28.021718</td>\n",
              "      <td>1.104336e+05</td>\n",
              "      <td>1.0</td>\n",
              "      <td>5.0</td>\n",
              "      <td>4.286184</td>\n",
              "      <td>16891.85</td>\n",
              "      <td>2</td>\n",
              "      <td>421</td>\n",
              "      <td>3941</td>\n",
              "      <td>591</td>\n",
              "      <td>50</td>\n",
              "      <td>46</td>\n",
              "      <td>4</td>\n",
              "      <td>4</td>\n",
              "      <td>17</td>\n",
              "      <td>25</td>\n",
              "      <td>4.363757</td>\n",
              "      <td>173</td>\n",
              "      <td>754.93</td>\n",
              "      <td>131147.121387</td>\n",
              "      <td>173</td>\n",
              "      <td>22688452</td>\n",
              "      <td>120.573874</td>\n",
              "      <td>173</td>\n",
              "      <td>20859.2802</td>\n",
              "      <td>51.141040</td>\n",
              "      <td>173</td>\n",
              "      <td>8847.4</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>16516 rows × 104 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "        Offered_By  ...  Category_Content_Rating_Size_sum\n",
              "0      ps_id-24654  ...                           37295.5\n",
              "1      ps_id-35329  ...                           26928.3\n",
              "2      ps_id-11044  ...                           21630.3\n",
              "3      ps_id-36068  ...                             497.9\n",
              "4      ps_id-35831  ...                           29046.3\n",
              "...            ...  ...                               ...\n",
              "16511   ps_id-5583  ...                           23175.0\n",
              "16512  ps_id-15485  ...                            1756.6\n",
              "16513  ps_id-36065  ...                           23175.0\n",
              "16514  ps_id-12625  ...                           44989.8\n",
              "16515   ps_id-4549  ...                            8847.4\n",
              "\n",
              "[16516 rows x 104 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 40
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "-kSyicsMNY5K",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "# sns.jointplot(x=\"Rating\",y=\"Reviews\",data=train,kind=\"kde\")"
      ],
      "execution_count": 41,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "QIQaOhv3KKER",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "outputId": "5288921b-b4ef-43b0-e2d2-17f519b4ad7e"
      },
      "source": [
        "import warnings\n",
        "warnings.filterwarnings(\"ignore\")\n",
        "X = train.drop(['Offered_By'],axis=1)\n",
        "Y = train[Target]\n",
        "\n",
        "folds = StratifiedKFold(n_splits=6,shuffle=True,random_state=42)\n",
        "\n",
        "best_score = 10\n",
        "scores =[]\n",
        "\n",
        "cat_params = {\n",
        "    \"od_type\":\"Iter\",\n",
        "    \"od_wait\":50,\n",
        "    # \"eval_metric\":\"Logloss\",\n",
        "    \"learning_rate\":0.0526,\n",
        "    \"n_estimators\":2000, \n",
        "    \"task_type\":\"GPU\",\n",
        "    \"depth\":5\n",
        "    # \"boosting_type\":\"Plain\"\n",
        "}\n",
        "\n",
        "final_preds = []\n",
        "for i,(train_idx,test_idx) in enumerate(folds.split(X,Y)):\n",
        "  X_train = X.iloc[train_idx]\n",
        "  X_test = X.iloc[test_idx]\n",
        "\n",
        "  # X_train = X_train.append(record)\n",
        "  # X_test = X_test.append(record)\n",
        "  r = record.drop(['Offered_By','is_train'],axis=1)\n",
        "\n",
        "  X_train = X_train.append(r,ignore_index=True)\n",
        "  X_train = X_train.append(r,ignore_index=True)\n",
        "\n",
        "  train_set = (X_train.drop(Target,axis=1),X_train[Target])\n",
        "  test_set = (X_test.drop(Target,axis=1),X_test[Target])\n",
        "  \n",
        "  # model = LGBMClassifier(learning_rate=0.04,n_estimators=2000)\n",
        "  # model.fit(*train_set,categorical_feature=['OS_Version_Required',\"Category\",\"Content_Rating\"], eval_set=[test_set],verbose=50,early_stopping_rounds=100)\n",
        "  \n",
        "  model = CatBoostClassifier(**cat_params)\n",
        "  model.fit(*train_set,cat_features=['OS_Version_Required',\"Category\",\"Content_Rating\"], eval_set=[test_set],verbose=50,early_stopping_rounds=100)\n",
        "  preds = model.predict_proba(test_set[0])\n",
        "  score = log_loss(test_set[1],preds,labels=list(range(0,18)))\n",
        "  scores.append(score)\n",
        "  if score < best_score:\n",
        "    best_score = score\n",
        "    best = train_set\n",
        "    val = test_set\n",
        "\n",
        "  print(score)\n",
        "  print(\"-\"*100)\n",
        "  print()\n",
        "\n",
        "  test_preds = testing_predictions(model)\n",
        "  final_preds.append(test_preds)\n",
        "\n",
        "\n",
        "print(\"Mean Score \",  np.array(scores).mean())\n",
        "print(\"Maximum Score \",np.array(scores).max())\n",
        "print(\"Minimum Score \",np.array(scores).min())"
      ],
      "execution_count": 42,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "0:\tlearn: 2.7723855\ttest: 2.7712068\tbest: 2.7712068 (0)\ttotal: 34.9ms\tremaining: 1m 9s\n",
            "50:\tlearn: 1.2362157\ttest: 1.2402867\tbest: 1.2402867 (50)\ttotal: 1.66s\tremaining: 1m 3s\n",
            "100:\tlearn: 1.1289933\ttest: 1.1510928\tbest: 1.1510928 (100)\ttotal: 3.25s\tremaining: 1m 1s\n",
            "150:\tlearn: 1.0836722\ttest: 1.1229781\tbest: 1.1229781 (150)\ttotal: 4.84s\tremaining: 59.2s\n",
            "200:\tlearn: 1.0538833\ttest: 1.1083010\tbest: 1.1083010 (200)\ttotal: 6.39s\tremaining: 57.2s\n",
            "250:\tlearn: 1.0303530\ttest: 1.0999763\tbest: 1.0999763 (250)\ttotal: 7.94s\tremaining: 55.3s\n",
            "300:\tlearn: 1.0108192\ttest: 1.0931525\tbest: 1.0931525 (300)\ttotal: 9.47s\tremaining: 53.5s\n",
            "350:\tlearn: 0.9938910\ttest: 1.0881446\tbest: 1.0881446 (350)\ttotal: 11s\tremaining: 51.8s\n",
            "400:\tlearn: 0.9790291\ttest: 1.0848302\tbest: 1.0848302 (400)\ttotal: 12.5s\tremaining: 50s\n",
            "450:\tlearn: 0.9632501\ttest: 1.0807299\tbest: 1.0807299 (450)\ttotal: 14.1s\tremaining: 48.4s\n",
            "500:\tlearn: 0.9494248\ttest: 1.0789992\tbest: 1.0789964 (497)\ttotal: 15.6s\tremaining: 46.7s\n",
            "550:\tlearn: 0.9357508\ttest: 1.0767953\tbest: 1.0767953 (550)\ttotal: 17.2s\tremaining: 45.1s\n",
            "600:\tlearn: 0.9229929\ttest: 1.0751939\tbest: 1.0751217 (599)\ttotal: 18.7s\tremaining: 43.4s\n",
            "650:\tlearn: 0.9103403\ttest: 1.0745710\tbest: 1.0745710 (650)\ttotal: 20.2s\tremaining: 41.8s\n",
            "700:\tlearn: 0.8988288\ttest: 1.0745264\tbest: 1.0743195 (679)\ttotal: 21.7s\tremaining: 40.2s\n",
            "750:\tlearn: 0.8879343\ttest: 1.0737251\tbest: 1.0736810 (747)\ttotal: 23.2s\tremaining: 38.6s\n",
            "800:\tlearn: 0.8765088\ttest: 1.0728286\tbest: 1.0728286 (800)\ttotal: 24.7s\tremaining: 37s\n",
            "850:\tlearn: 0.8654039\ttest: 1.0724617\tbest: 1.0724617 (850)\ttotal: 26.3s\tremaining: 35.5s\n",
            "900:\tlearn: 0.8547555\ttest: 1.0727039\tbest: 1.0723426 (859)\ttotal: 27.8s\tremaining: 33.9s\n",
            "950:\tlearn: 0.8441627\ttest: 1.0715781\tbest: 1.0715781 (950)\ttotal: 29.3s\tremaining: 32.3s\n",
            "1000:\tlearn: 0.8339085\ttest: 1.0720193\tbest: 1.0715781 (950)\ttotal: 30.8s\tremaining: 30.8s\n",
            "1050:\tlearn: 0.8246619\ttest: 1.0721127\tbest: 1.0715781 (950)\ttotal: 32.4s\tremaining: 29.2s\n",
            "bestTest = 1.071578076\n",
            "bestIteration = 950\n",
            "Shrink model to first 951 iterations.\n",
            "1.0715779617285826\n",
            "----------------------------------------------------------------------------------------------------\n",
            "\n",
            "0:\tlearn: 2.7764169\ttest: 2.7742202\tbest: 2.7742202 (0)\ttotal: 28.9ms\tremaining: 57.8s\n",
            "50:\tlearn: 1.2297687\ttest: 1.2528435\tbest: 1.2528435 (50)\ttotal: 1.33s\tremaining: 51s\n",
            "100:\tlearn: 1.1272569\ttest: 1.1644096\tbest: 1.1644096 (100)\ttotal: 2.71s\tremaining: 51s\n",
            "150:\tlearn: 1.0844724\ttest: 1.1360083\tbest: 1.1360083 (150)\ttotal: 4.14s\tremaining: 50.7s\n",
            "200:\tlearn: 1.0547240\ttest: 1.1203247\tbest: 1.1203247 (200)\ttotal: 5.53s\tremaining: 49.5s\n",
            "250:\tlearn: 1.0300809\ttest: 1.1079858\tbest: 1.1079858 (250)\ttotal: 6.94s\tremaining: 48.4s\n",
            "300:\tlearn: 1.0097693\ttest: 1.1003040\tbest: 1.1003040 (300)\ttotal: 8.35s\tremaining: 47.1s\n",
            "350:\tlearn: 0.9917479\ttest: 1.0947087\tbest: 1.0947087 (350)\ttotal: 9.77s\tremaining: 45.9s\n",
            "400:\tlearn: 0.9752637\ttest: 1.0900369\tbest: 1.0900369 (400)\ttotal: 11.2s\tremaining: 44.6s\n",
            "450:\tlearn: 0.9608603\ttest: 1.0875700\tbest: 1.0875700 (450)\ttotal: 12.6s\tremaining: 43.3s\n",
            "500:\tlearn: 0.9475136\ttest: 1.0844752\tbest: 1.0844752 (500)\ttotal: 14s\tremaining: 42s\n",
            "550:\tlearn: 0.9348685\ttest: 1.0817827\tbest: 1.0817827 (550)\ttotal: 15.4s\tremaining: 40.5s\n",
            "600:\tlearn: 0.9223163\ttest: 1.0789829\tbest: 1.0789829 (600)\ttotal: 16.8s\tremaining: 39.1s\n",
            "650:\tlearn: 0.9100162\ttest: 1.0777994\tbest: 1.0777843 (648)\ttotal: 18.2s\tremaining: 37.8s\n",
            "700:\tlearn: 0.8979343\ttest: 1.0766391\tbest: 1.0764651 (690)\ttotal: 19.7s\tremaining: 36.5s\n",
            "750:\tlearn: 0.8866763\ttest: 1.0742617\tbest: 1.0742617 (750)\ttotal: 21.1s\tremaining: 35.1s\n",
            "800:\tlearn: 0.8755356\ttest: 1.0728288\tbest: 1.0728288 (800)\ttotal: 22.6s\tremaining: 33.8s\n",
            "850:\tlearn: 0.8644558\ttest: 1.0720874\tbest: 1.0719252 (838)\ttotal: 24.1s\tremaining: 32.5s\n",
            "900:\tlearn: 0.8549465\ttest: 1.0707640\tbest: 1.0707639 (899)\ttotal: 25.5s\tremaining: 31.1s\n",
            "950:\tlearn: 0.8443557\ttest: 1.0698084\tbest: 1.0698084 (950)\ttotal: 27s\tremaining: 29.7s\n",
            "1000:\tlearn: 0.8340193\ttest: 1.0693115\tbest: 1.0691897 (987)\ttotal: 28.4s\tremaining: 28.4s\n",
            "1050:\tlearn: 0.8229952\ttest: 1.0688574\tbest: 1.0686564 (1045)\ttotal: 29.9s\tremaining: 27s\n",
            "1100:\tlearn: 0.8135906\ttest: 1.0685744\tbest: 1.0684268 (1094)\ttotal: 31.4s\tremaining: 25.6s\n",
            "1150:\tlearn: 0.8045689\ttest: 1.0682782\tbest: 1.0681417 (1147)\ttotal: 32.9s\tremaining: 24.2s\n",
            "1200:\tlearn: 0.7947022\ttest: 1.0677578\tbest: 1.0676400 (1193)\ttotal: 34.4s\tremaining: 22.9s\n",
            "1250:\tlearn: 0.7849380\ttest: 1.0682505\tbest: 1.0676400 (1193)\ttotal: 35.9s\tremaining: 21.5s\n",
            "bestTest = 1.067639989\n",
            "bestIteration = 1193\n",
            "Shrink model to first 1194 iterations.\n",
            "1.0676400275337905\n",
            "----------------------------------------------------------------------------------------------------\n",
            "\n",
            "0:\tlearn: 2.7761604\ttest: 2.7762895\tbest: 2.7762895 (0)\ttotal: 45.1ms\tremaining: 1m 30s\n",
            "50:\tlearn: 1.2323437\ttest: 1.2493822\tbest: 1.2493822 (50)\ttotal: 1.32s\tremaining: 50.3s\n",
            "100:\tlearn: 1.1308090\ttest: 1.1631054\tbest: 1.1631054 (100)\ttotal: 2.63s\tremaining: 49.4s\n",
            "150:\tlearn: 1.0817656\ttest: 1.1297858\tbest: 1.1297858 (150)\ttotal: 3.99s\tremaining: 48.8s\n",
            "200:\tlearn: 1.0537126\ttest: 1.1163232\tbest: 1.1163232 (200)\ttotal: 5.36s\tremaining: 48s\n",
            "250:\tlearn: 1.0279721\ttest: 1.1042061\tbest: 1.1042061 (250)\ttotal: 6.68s\tremaining: 46.5s\n",
            "300:\tlearn: 1.0086537\ttest: 1.0978980\tbest: 1.0978980 (300)\ttotal: 8.02s\tremaining: 45.3s\n",
            "350:\tlearn: 0.9919573\ttest: 1.0933736\tbest: 1.0933736 (350)\ttotal: 9.35s\tremaining: 43.9s\n",
            "400:\tlearn: 0.9773506\ttest: 1.0896822\tbest: 1.0896822 (400)\ttotal: 10.6s\tremaining: 42.5s\n",
            "450:\tlearn: 0.9626622\ttest: 1.0874767\tbest: 1.0874133 (449)\ttotal: 12s\tremaining: 41.2s\n",
            "500:\tlearn: 0.9480057\ttest: 1.0853978\tbest: 1.0853978 (494)\ttotal: 13.3s\tremaining: 39.9s\n",
            "550:\tlearn: 0.9354642\ttest: 1.0841275\tbest: 1.0841275 (550)\ttotal: 14.7s\tremaining: 38.6s\n",
            "600:\tlearn: 0.9230349\ttest: 1.0832378\tbest: 1.0832199 (598)\ttotal: 16s\tremaining: 37.2s\n",
            "650:\tlearn: 0.9108158\ttest: 1.0812055\tbest: 1.0812055 (650)\ttotal: 17.2s\tremaining: 35.7s\n",
            "700:\tlearn: 0.8993846\ttest: 1.0801183\tbest: 1.0800089 (699)\ttotal: 18.6s\tremaining: 34.4s\n",
            "750:\tlearn: 0.8870457\ttest: 1.0793878\tbest: 1.0793192 (743)\ttotal: 19.9s\tremaining: 33s\n",
            "800:\tlearn: 0.8763364\ttest: 1.0783870\tbest: 1.0783409 (796)\ttotal: 21.2s\tremaining: 31.7s\n",
            "850:\tlearn: 0.8646832\ttest: 1.0777476\tbest: 1.0777476 (850)\ttotal: 22.5s\tremaining: 30.3s\n",
            "900:\tlearn: 0.8531047\ttest: 1.0776025\tbest: 1.0772992 (897)\ttotal: 23.7s\tremaining: 29s\n",
            "950:\tlearn: 0.8427622\ttest: 1.0776357\tbest: 1.0772545 (929)\ttotal: 25s\tremaining: 27.6s\n",
            "1000:\tlearn: 0.8320646\ttest: 1.0775422\tbest: 1.0772545 (929)\ttotal: 26.3s\tremaining: 26.3s\n",
            "bestTest = 1.077254501\n",
            "bestIteration = 929\n",
            "Shrink model to first 930 iterations.\n",
            "1.077254408073836\n",
            "----------------------------------------------------------------------------------------------------\n",
            "\n",
            "0:\tlearn: 2.7719647\ttest: 2.7710552\tbest: 2.7710552 (0)\ttotal: 27.8ms\tremaining: 55.5s\n",
            "50:\tlearn: 1.2305347\ttest: 1.2480802\tbest: 1.2480802 (50)\ttotal: 1.33s\tremaining: 50.7s\n",
            "100:\tlearn: 1.1255935\ttest: 1.1572349\tbest: 1.1572349 (100)\ttotal: 2.72s\tremaining: 51.2s\n",
            "150:\tlearn: 1.0821785\ttest: 1.1289579\tbest: 1.1289579 (150)\ttotal: 4.14s\tremaining: 50.7s\n",
            "200:\tlearn: 1.0540796\ttest: 1.1138482\tbest: 1.1138265 (199)\ttotal: 5.51s\tremaining: 49.3s\n",
            "250:\tlearn: 1.0320571\ttest: 1.1044383\tbest: 1.1044383 (250)\ttotal: 6.85s\tremaining: 47.7s\n",
            "300:\tlearn: 1.0129050\ttest: 1.0954522\tbest: 1.0954522 (300)\ttotal: 8.21s\tremaining: 46.3s\n",
            "350:\tlearn: 0.9972013\ttest: 1.0910065\tbest: 1.0910065 (350)\ttotal: 9.64s\tremaining: 45.3s\n",
            "400:\tlearn: 0.9818325\ttest: 1.0871266\tbest: 1.0871036 (398)\ttotal: 11s\tremaining: 43.9s\n",
            "450:\tlearn: 0.9676205\ttest: 1.0836983\tbest: 1.0836869 (441)\ttotal: 12.4s\tremaining: 42.6s\n",
            "500:\tlearn: 0.9532907\ttest: 1.0821707\tbest: 1.0819451 (499)\ttotal: 13.8s\tremaining: 41.4s\n",
            "550:\tlearn: 0.9404188\ttest: 1.0801924\tbest: 1.0801924 (550)\ttotal: 15.3s\tremaining: 40.1s\n",
            "600:\tlearn: 0.9267127\ttest: 1.0784562\tbest: 1.0784272 (599)\ttotal: 16.7s\tremaining: 38.8s\n",
            "650:\tlearn: 0.9139845\ttest: 1.0766375\tbest: 1.0764142 (636)\ttotal: 18.1s\tremaining: 37.4s\n",
            "700:\tlearn: 0.9020502\ttest: 1.0752751\tbest: 1.0751967 (698)\ttotal: 19.5s\tremaining: 36.1s\n",
            "750:\tlearn: 0.8921285\ttest: 1.0745071\tbest: 1.0745022 (749)\ttotal: 20.8s\tremaining: 34.7s\n",
            "800:\tlearn: 0.8800681\ttest: 1.0741939\tbest: 1.0741939 (800)\ttotal: 22.3s\tremaining: 33.3s\n",
            "850:\tlearn: 0.8679693\ttest: 1.0728610\tbest: 1.0728610 (850)\ttotal: 23.6s\tremaining: 31.9s\n",
            "900:\tlearn: 0.8572602\ttest: 1.0726721\tbest: 1.0726285 (898)\ttotal: 25s\tremaining: 30.5s\n",
            "950:\tlearn: 0.8471577\ttest: 1.0722666\tbest: 1.0721202 (938)\ttotal: 26.4s\tremaining: 29.1s\n",
            "1000:\tlearn: 0.8371304\ttest: 1.0719628\tbest: 1.0718160 (993)\ttotal: 27.8s\tremaining: 27.7s\n",
            "1050:\tlearn: 0.8279235\ttest: 1.0713834\tbest: 1.0713323 (1046)\ttotal: 29.2s\tremaining: 26.3s\n",
            "1100:\tlearn: 0.8186488\ttest: 1.0710882\tbest: 1.0709266 (1067)\ttotal: 30.6s\tremaining: 25s\n",
            "1150:\tlearn: 0.8092301\ttest: 1.0707778\tbest: 1.0707051 (1144)\ttotal: 32s\tremaining: 23.6s\n",
            "1200:\tlearn: 0.7988787\ttest: 1.0713730\tbest: 1.0706945 (1152)\ttotal: 33.4s\tremaining: 22.2s\n",
            "1250:\tlearn: 0.7893084\ttest: 1.0706002\tbest: 1.0705706 (1247)\ttotal: 34.7s\tremaining: 20.8s\n",
            "1300:\tlearn: 0.7811588\ttest: 1.0700729\tbest: 1.0700411 (1295)\ttotal: 36.1s\tremaining: 19.4s\n",
            "1350:\tlearn: 0.7722589\ttest: 1.0705674\tbest: 1.0700007 (1305)\ttotal: 37.5s\tremaining: 18s\n",
            "1400:\tlearn: 0.7630697\ttest: 1.0709447\tbest: 1.0700007 (1305)\ttotal: 38.9s\tremaining: 16.6s\n",
            "bestTest = 1.070000695\n",
            "bestIteration = 1305\n",
            "Shrink model to first 1306 iterations.\n",
            "1.0700006280792644\n",
            "----------------------------------------------------------------------------------------------------\n",
            "\n",
            "0:\tlearn: 2.7721776\ttest: 2.7702261\tbest: 2.7702261 (0)\ttotal: 28.2ms\tremaining: 56.3s\n",
            "50:\tlearn: 1.2321417\ttest: 1.2456298\tbest: 1.2456298 (50)\ttotal: 1.3s\tremaining: 49.7s\n",
            "100:\tlearn: 1.1274769\ttest: 1.1578680\tbest: 1.1578680 (100)\ttotal: 2.56s\tremaining: 48.2s\n",
            "150:\tlearn: 1.0828311\ttest: 1.1314839\tbest: 1.1314839 (150)\ttotal: 3.91s\tremaining: 47.9s\n",
            "200:\tlearn: 1.0517941\ttest: 1.1155661\tbest: 1.1155661 (200)\ttotal: 5.21s\tremaining: 46.6s\n",
            "250:\tlearn: 1.0270135\ttest: 1.1037325\tbest: 1.1037325 (250)\ttotal: 6.47s\tremaining: 45.1s\n",
            "300:\tlearn: 1.0066768\ttest: 1.0976851\tbest: 1.0976851 (300)\ttotal: 7.75s\tremaining: 43.7s\n",
            "350:\tlearn: 0.9892428\ttest: 1.0916738\tbest: 1.0916738 (350)\ttotal: 9.03s\tremaining: 42.4s\n",
            "400:\tlearn: 0.9732062\ttest: 1.0885187\tbest: 1.0884277 (398)\ttotal: 10.4s\tremaining: 41.4s\n",
            "450:\tlearn: 0.9589335\ttest: 1.0864086\tbest: 1.0863897 (448)\ttotal: 11.7s\tremaining: 40.1s\n",
            "500:\tlearn: 0.9457174\ttest: 1.0844573\tbest: 1.0844573 (500)\ttotal: 12.9s\tremaining: 38.7s\n",
            "550:\tlearn: 0.9322859\ttest: 1.0811469\tbest: 1.0811469 (550)\ttotal: 14.3s\tremaining: 37.5s\n",
            "600:\tlearn: 0.9192318\ttest: 1.0799992\tbest: 1.0799763 (599)\ttotal: 15.6s\tremaining: 36.3s\n",
            "650:\tlearn: 0.9066670\ttest: 1.0785839\tbest: 1.0785839 (650)\ttotal: 16.9s\tremaining: 35.1s\n",
            "700:\tlearn: 0.8953951\ttest: 1.0768948\tbest: 1.0768948 (700)\ttotal: 18.2s\tremaining: 33.8s\n",
            "750:\tlearn: 0.8840705\ttest: 1.0758773\tbest: 1.0758773 (750)\ttotal: 19.6s\tremaining: 32.7s\n",
            "800:\tlearn: 0.8722486\ttest: 1.0752979\tbest: 1.0750617 (789)\ttotal: 21s\tremaining: 31.5s\n",
            "850:\tlearn: 0.8604693\ttest: 1.0746764\tbest: 1.0746332 (848)\ttotal: 22.4s\tremaining: 30.3s\n",
            "900:\tlearn: 0.8489327\ttest: 1.0741612\tbest: 1.0738743 (892)\ttotal: 23.8s\tremaining: 29s\n",
            "950:\tlearn: 0.8386825\ttest: 1.0729091\tbest: 1.0728118 (945)\ttotal: 25.2s\tremaining: 27.8s\n",
            "1000:\tlearn: 0.8285951\ttest: 1.0723573\tbest: 1.0722491 (987)\ttotal: 26.6s\tremaining: 26.5s\n",
            "1050:\tlearn: 0.8197429\ttest: 1.0724714\tbest: 1.0722491 (987)\ttotal: 28s\tremaining: 25.3s\n",
            "1100:\tlearn: 0.8106463\ttest: 1.0721142\tbest: 1.0720875 (1099)\ttotal: 29.4s\tremaining: 24s\n",
            "1150:\tlearn: 0.8009227\ttest: 1.0725564\tbest: 1.0720875 (1099)\ttotal: 30.8s\tremaining: 22.7s\n",
            "bestTest = 1.072087488\n",
            "bestIteration = 1099\n",
            "Shrink model to first 1100 iterations.\n",
            "1.072087457114243\n",
            "----------------------------------------------------------------------------------------------------\n",
            "\n",
            "0:\tlearn: 2.7737888\ttest: 2.7739591\tbest: 2.7739591 (0)\ttotal: 29.4ms\tremaining: 58.8s\n",
            "50:\tlearn: 1.2366586\ttest: 1.2354576\tbest: 1.2354576 (50)\ttotal: 1.3s\tremaining: 49.6s\n",
            "100:\tlearn: 1.1359346\ttest: 1.1483405\tbest: 1.1483405 (100)\ttotal: 2.62s\tremaining: 49.2s\n",
            "150:\tlearn: 1.0878373\ttest: 1.1150289\tbest: 1.1150289 (150)\ttotal: 3.92s\tremaining: 48.1s\n",
            "200:\tlearn: 1.0583913\ttest: 1.0984703\tbest: 1.0984703 (200)\ttotal: 5.2s\tremaining: 46.6s\n",
            "250:\tlearn: 1.0339448\ttest: 1.0860809\tbest: 1.0860809 (250)\ttotal: 6.5s\tremaining: 45.3s\n",
            "300:\tlearn: 1.0141398\ttest: 1.0790717\tbest: 1.0790578 (298)\ttotal: 7.81s\tremaining: 44.1s\n",
            "350:\tlearn: 0.9971991\ttest: 1.0734414\tbest: 1.0734414 (350)\ttotal: 9.12s\tremaining: 42.8s\n",
            "400:\tlearn: 0.9810735\ttest: 1.0690508\tbest: 1.0690508 (400)\ttotal: 10.4s\tremaining: 41.7s\n",
            "450:\tlearn: 0.9669930\ttest: 1.0651982\tbest: 1.0651982 (450)\ttotal: 11.8s\tremaining: 40.4s\n",
            "500:\tlearn: 0.9530938\ttest: 1.0624807\tbest: 1.0624807 (500)\ttotal: 13.1s\tremaining: 39.2s\n",
            "550:\tlearn: 0.9394834\ttest: 1.0601806\tbest: 1.0601806 (550)\ttotal: 14.4s\tremaining: 37.8s\n",
            "600:\tlearn: 0.9275176\ttest: 1.0585350\tbest: 1.0585170 (596)\ttotal: 15.7s\tremaining: 36.6s\n",
            "650:\tlearn: 0.9165421\ttest: 1.0571003\tbest: 1.0571003 (650)\ttotal: 17s\tremaining: 35.2s\n",
            "700:\tlearn: 0.9041617\ttest: 1.0563625\tbest: 1.0563625 (700)\ttotal: 18.3s\tremaining: 34s\n",
            "750:\tlearn: 0.8920563\ttest: 1.0550243\tbest: 1.0550243 (750)\ttotal: 19.7s\tremaining: 32.7s\n",
            "800:\tlearn: 0.8806143\ttest: 1.0549423\tbest: 1.0545954 (789)\ttotal: 21s\tremaining: 31.4s\n",
            "850:\tlearn: 0.8700987\ttest: 1.0538008\tbest: 1.0538008 (850)\ttotal: 22.3s\tremaining: 30.1s\n",
            "900:\tlearn: 0.8591549\ttest: 1.0540803\tbest: 1.0538008 (850)\ttotal: 23.7s\tremaining: 28.9s\n",
            "950:\tlearn: 0.8481664\ttest: 1.0532032\tbest: 1.0531645 (948)\ttotal: 25s\tremaining: 27.6s\n",
            "1000:\tlearn: 0.8377747\ttest: 1.0531999\tbest: 1.0530334 (993)\ttotal: 26.3s\tremaining: 26.2s\n",
            "1050:\tlearn: 0.8266839\ttest: 1.0525061\tbest: 1.0524919 (1049)\ttotal: 27.6s\tremaining: 24.9s\n",
            "1100:\tlearn: 0.8170590\ttest: 1.0528043\tbest: 1.0523113 (1054)\ttotal: 29s\tremaining: 23.7s\n",
            "1150:\tlearn: 0.8069565\ttest: 1.0525357\tbest: 1.0523113 (1054)\ttotal: 30.3s\tremaining: 22.4s\n",
            "bestTest = 1.052311298\n",
            "bestIteration = 1054\n",
            "Shrink model to first 1055 iterations.\n",
            "1.052311414670667\n",
            "----------------------------------------------------------------------------------------------------\n",
            "\n",
            "Mean Score  1.0684786495333973\n",
            "Maximum Score  1.077254408073836\n",
            "Minimum Score  1.052311414670667\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "CfNtQdoGQzcu",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 282
        },
        "outputId": "36cf84f7-11f0-4557-95b3-a8cc37df3516"
      },
      "source": [
        "sns.boxplot(scores)"
      ],
      "execution_count": 46,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "<matplotlib.axes._subplots.AxesSubplot at 0x7fa41e4d6cf8>"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 46
        },
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAD4CAYAAADSIzzWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAJP0lEQVR4nO3d34vldR3H8ddnd1BXJMpZEZnKyYaQICjZQoqCxIXFm7yQsC7WQAi7GBchiP6ArrooHYLwotwliH7QDy/WLaWiK62VzF3Ui5MpOVitI1qyqznrt4tzJqZ1R53Zc857zpnHA4aZ+Z4z8/289+M+/Z7vMNq6rgsA47eregEAO5UAAxQRYIAiAgxQRIABisxs5sl79+7t5ufnR7QUgOn06KOPvtB13RXnHt9UgOfn53P8+PHhrQpgB2itPXu+425BABQRYIAiAgxQRIABiggwQBEBBigiwABFBBigiAADFBFggCICDFBEgAGKCDBAEQEGKCLAAEUEGKCIAAMUEWCAIgIMUGRT/084YOuWlpbS6/VKzr28vJwkmZub29LXLywsZHFxcZhLIgIMY9Pr9fLYySdz9tLLx37u3adfTpL8/bXN/5XfffrFYS+HAQGGMTp76eU5c+1NYz/vnqeOJsmWzr32tQyfe8AARQQYoIgAAxQRYIAiAgxQRIABiggwQBEBBigiwABFBBigiAADFBFggCICDFBEgAGKCDBAEQEGKCLAAEUEGKCIAAMUEWCAIgIMUESAAYoIMEARAQYoIsAARQQYoIgAAxQRYIAiAgxQRIABiggwQBEBBigiwABFBBigiAADFBFggCICDFBEgAGKCDBAEQEGKCLAAEUEGIZoaWkpS0tL1ctgiEa5pzMj+a6wQ/V6veolMGSj3FNXwABFBBigiAADFBFggCICDFBEgAGKCDBAEQEGKCLAAEUEGKCIAAMUEWCAIgIMUESAAYoIMEARAQYoIsAARQQYoIgAAxQRYIAiAgxQRIABiggwQBEBBigiwABFBBigiAADFBFggCICDFBEgAGKCDBAEQEGKCLAAEUEGKCIAAMUEWCAIgIMUESAAYqMJcArKyu58847s7KyMo7TAUyEsQT48OHDOXHiRI4cOTKO0wFMhJEHeGVlJceOHUvXdTl27JirYICBmVGf4PDhw3njjTeSJGfPns2RI0dy1113jfq0UGJ5eTlnzpzJoUOH3vRYr9fLrv90Bau6MLte/Vd6vX+fd6adoNfrZc+ePSP53m97Bdxa+3Jr7Xhr7fipU6c2fYKHHnooq6urSZLV1dU8+OCDm18lwBR62yvgruvuTXJvkuzbt2/T//q+8cYbc/To0ayurmZmZib79+/fwjJhMszNzSVJ7r777jc9dujQoTz69D/GvaQL9sYl78rCNVeed6adYJRX/iO/B3zbbbdl167+aXbv3p2DBw+O+pQAE2HkAZ6dnc2BAwfSWsuBAwcyOzs76lMCTISR/xAu6V8FP/PMM65+AdYZS4BnZ2dzzz33jONUABPDryIDFBFggCICDFBEgAGKCDBAEQEGKCLAAEUEGKCIAAMUEWCAIgIMUESAAYoIMEARAQYoIsAARQQYoIgAAxQRYIAiAgxQRIABiggwQBEBBigiwABFBBigiAADFBFggCICDFBEgAGKCDBAEQEGKCLAAEUEGKCIAAMUEWCAIgIMUESAAYoIMEARAQYoMlO9AJgmCwsL1UtgyEa5pwIMQ7S4uFi9BIZslHvqFgRAEQEGKCLAAEUEGKCIAAMUEWCAIgIMUESAAYoIMEARAQYoIsAARQQYoIgAAxQRYIAiAgxQRIABiggwQBEBBigiwABFBBigiAADFBFggCICDFBEgAGKCDBAEQEGKCLAAEUEGKCIAAMUEWCAIgIMUESAAYoIMEARAQYoIsAARQQYoIgAAxQRYIAiAgxQRIABisxULwB2kt2nX8yep44WnHclSbZ07t2nX0xy5ZBXRCLAMDYLCwtl515eXk2SzM1tJaRXlq59mgkwjMni4mL1Ethm3AMGKCLAAEUEGKCIAAMUEWCAIgIMUESAAYoIMEARAQYoIsAARQQYoIgAAxQRYIAiAgxQRIABiggwQBEBBigiwABFBBigiAADFGld173zJ7d2Ksmzo1vOyO1N8kL1IsbMzDuDmbe3q7uuu+Lcg5sK8KRrrR3vum5f9TrGycw7g5knk1sQAEUEGKDITgvwvdULKGDmncHME2hH3QMG2E522hUwwLYhwABFJjbArbXvtdb+2Vo7ucHjrbV2T2ut11p7vLV23brHzrbWHhu83b/u+H2ttb+ue+yj45jlnbrAmd/fWvt1a+3J1toTrbX5wfEPtNYeGXzNj1prF41nmndmRDNP5T631j67bqbHWmuvttZuHjw2lfv8NjNv631OknRdN5FvST6T5LokJzd4/KYkDyRpSa5P8si6x17Z4GvuS3JL9Wwjmvl3SfYPPr4syaWDj3+c5NbBx99N8pXqOccw89Tu87rnXJ7kxZ2wz28x87be567rJvcKuOu636f/h72RzyU50vU9nOTdrbWrxrO60djqzK21DyeZ6bruwcH3eaXrutOttZbkhiQ/HXz94SQ3j3CETRv2zGNY8gUb0j/btyR5YNr3+Zzn/G/mUa1z2CY2wO/AXJK/rfv8ucGxJLmktXa8tfbw2suVdb4xeInzrdbaxWNZ6fBsNPOHkrzUWvtZa+1PrbVvttZ2J5lN8lLXdavnPH+SbHbmNdO4z+vdmuSHg4+neZ/XWz/zmm29z9Mc4Ldyddf/FcYvJvl2a+2Dg+NfT3Jtko+n/3Lma0XrG7aZJJ9O8tX0Z7smyZcqFzQGbzXztO5zkmRwZfiRJL+qXsu4bDDztt/naQ7wcpL3rfv8vYNj6bpu7f3T6d8n/Njg8+cHL3FeS/L9JJ8Y54KHYKOZn0vyWNd1Tw+ugn6R/v22lfRfys2c8/xJstmZp3mf13w+yc+7rnt98Pk07/Oac2eeiH2e5gDfn+Tg4Ken1yd5ueu651tr71l7KdJa25vkU0meGHx+1eB9S/8e2Xl/IruNnXfmJH9M/y/g2n+N6YYkT3T9n1T8Nv17Z0lyW5JfjnvRF2hTMydTvc9rvpB1L8WnfJ/X/N/MyYTsc/VPAbf6lv4f9vNJXk//auf2JHckuWPweEvynSR/SXIiyb7B8U8OPv/z4P3t677nbwbHTib5QZLLquccxsyDx/YneXxw/L4kFw2OX5PkD0l6SX6S5OLqOccw8zTv83z6V4a7zvme07zPG828rfe56zq/igxQZZpvQQBsawIMUESAAYoIMEARAQYoIsAARQQYoMh/Ae8vzeWhMYu5AAAAAElFTkSuQmCC\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "0sb7hix2NbM5",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 470
        },
        "outputId": "d4d7aa08-917c-4869-c32d-500c58d85583"
      },
      "source": [
        "# model = CatBoostClassifier(**cat_params)\n",
        "# model.fit(*best,cat_features=['OS_Version_Required',\"Category\",\"Content_Rating\"], eval_set=[val],verbose=50,early_stopping_rounds=50)\n",
        "# # model = LGBMClassifier(learning_rate=0.04,n_estimators=2000)\n",
        "# # model.fit(*train_set,categorical_feature=['OS_Version_Required',\"Category\",\"Content_Rating\"], eval_set=[test_set],verbose=50,early_stopping_rounds=100)\n",
        "# preds = model.predict_proba(val[0])\n",
        "# score = log_loss(val[1],preds,labels=list(range(0,18)))\n",
        "# print(score)"
      ],
      "execution_count": 43,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "0:\tlearn: 2.7737888\ttest: 2.7739591\tbest: 2.7739591 (0)\ttotal: 29.2ms\tremaining: 58.3s\n",
            "50:\tlearn: 1.2373729\ttest: 1.2371258\tbest: 1.2371258 (50)\ttotal: 1.29s\tremaining: 49.2s\n",
            "100:\tlearn: 1.1337916\ttest: 1.1472239\tbest: 1.1472239 (100)\ttotal: 2.66s\tremaining: 50s\n",
            "150:\tlearn: 1.0856069\ttest: 1.1135367\tbest: 1.1135367 (150)\ttotal: 4.03s\tremaining: 49.3s\n",
            "200:\tlearn: 1.0568053\ttest: 1.0969630\tbest: 1.0969630 (200)\ttotal: 5.41s\tremaining: 48.4s\n",
            "250:\tlearn: 1.0325728\ttest: 1.0847372\tbest: 1.0847363 (249)\ttotal: 6.81s\tremaining: 47.4s\n",
            "300:\tlearn: 1.0130010\ttest: 1.0778873\tbest: 1.0778873 (300)\ttotal: 8.18s\tremaining: 46.2s\n",
            "350:\tlearn: 0.9963917\ttest: 1.0728469\tbest: 1.0728373 (349)\ttotal: 9.58s\tremaining: 45s\n",
            "400:\tlearn: 0.9801886\ttest: 1.0682568\tbest: 1.0682568 (400)\ttotal: 11s\tremaining: 43.7s\n",
            "450:\tlearn: 0.9664083\ttest: 1.0653997\tbest: 1.0653997 (450)\ttotal: 12.3s\tremaining: 42.3s\n",
            "500:\tlearn: 0.9528707\ttest: 1.0624303\tbest: 1.0624303 (500)\ttotal: 13.8s\tremaining: 41.1s\n",
            "550:\tlearn: 0.9393036\ttest: 1.0607457\tbest: 1.0607385 (548)\ttotal: 15.1s\tremaining: 39.8s\n",
            "600:\tlearn: 0.9272140\ttest: 1.0592101\tbest: 1.0590853 (593)\ttotal: 16.5s\tremaining: 38.5s\n",
            "650:\tlearn: 0.9156947\ttest: 1.0585315\tbest: 1.0584791 (645)\ttotal: 17.9s\tremaining: 37.1s\n",
            "700:\tlearn: 0.9038202\ttest: 1.0575145\tbest: 1.0575145 (700)\ttotal: 19.3s\tremaining: 35.8s\n",
            "750:\tlearn: 0.8919518\ttest: 1.0564415\tbest: 1.0564415 (750)\ttotal: 20.7s\tremaining: 34.4s\n",
            "800:\tlearn: 0.8801916\ttest: 1.0561004\tbest: 1.0557737 (789)\ttotal: 22.1s\tremaining: 33s\n",
            "850:\tlearn: 0.8697433\ttest: 1.0550931\tbest: 1.0550931 (850)\ttotal: 23.4s\tremaining: 31.6s\n",
            "900:\tlearn: 0.8592223\ttest: 1.0547588\tbest: 1.0547588 (900)\ttotal: 24.8s\tremaining: 30.3s\n",
            "950:\tlearn: 0.8487865\ttest: 1.0542360\tbest: 1.0541497 (923)\ttotal: 26.2s\tremaining: 28.9s\n",
            "1000:\tlearn: 0.8386193\ttest: 1.0541463\tbest: 1.0539190 (978)\ttotal: 27.7s\tremaining: 27.6s\n",
            "1050:\tlearn: 0.8278146\ttest: 1.0534377\tbest: 1.0534192 (1049)\ttotal: 29.1s\tremaining: 26.2s\n",
            "1100:\tlearn: 0.8185553\ttest: 1.0536977\tbest: 1.0532428 (1055)\ttotal: 30.4s\tremaining: 24.8s\n",
            "bestTest = 1.053242794\n",
            "bestIteration = 1055\n",
            "Shrink model to first 1056 iterations.\n",
            "1.0532427995880944\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "kHXytDa90bT5",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "outputId": "73c8b516-e343-42ed-8339-c4d30fe8839b"
      },
      "source": [
        "# pd.set_option(\"display.max_rows\",150)\n",
        "\n",
        "# imp = pd.DataFrame(list(zip(X_train.drop(Target,axis=1).columns,model.feature_importances_)),columns=[\"feature\",\"Importance\"]).sort_values(\"Importance\",ascending=False)\n",
        "# imp\n",
        "# # [imp.Importance == 0]"
      ],
      "execution_count": 33,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>feature</th>\n",
              "      <th>Importance</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>Reviews</td>\n",
              "      <td>14.685999</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>Reviews_per_rating</td>\n",
              "      <td>13.659587</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>33</th>\n",
              "      <td>Offered_By_Reviews_max</td>\n",
              "      <td>5.024228</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>35</th>\n",
              "      <td>Offered_By_Reviews_sum</td>\n",
              "      <td>4.746836</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>32</th>\n",
              "      <td>Offered_By_Reviews_min</td>\n",
              "      <td>4.434028</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>34</th>\n",
              "      <td>Offered_By_Reviews_mean</td>\n",
              "      <td>3.242454</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>Rating</td>\n",
              "      <td>2.540379</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>Last_Updated_On_week</td>\n",
              "      <td>2.306738</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>Last_Updated_On_day</td>\n",
              "      <td>2.273866</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>45</th>\n",
              "      <td>Offered_By_Rating_max</td>\n",
              "      <td>1.973929</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>44</th>\n",
              "      <td>Offered_By_Rating_min</td>\n",
              "      <td>1.918678</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>90</th>\n",
              "      <td>Category_OS_Version_Required_Rating_mean</td>\n",
              "      <td>1.726054</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>46</th>\n",
              "      <td>Offered_By_Rating_mean</td>\n",
              "      <td>1.540209</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>96</th>\n",
              "      <td>Category_OS_Version_Required_Price_mean</td>\n",
              "      <td>1.532843</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>99</th>\n",
              "      <td>Category_OS_Version_Required_Size_mean</td>\n",
              "      <td>1.460773</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>Category</td>\n",
              "      <td>1.458660</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>Category_Reviews_sum</td>\n",
              "      <td>1.208632</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>47</th>\n",
              "      <td>Offered_By_Rating_sum</td>\n",
              "      <td>1.175228</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>93</th>\n",
              "      <td>Category_OS_Version_Required_Reviews_mean</td>\n",
              "      <td>1.135189</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>107</th>\n",
              "      <td>Category_Content_Rating_Reviews_sum</td>\n",
              "      <td>1.133419</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>Size</td>\n",
              "      <td>1.097743</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>111</th>\n",
              "      <td>Category_Content_Rating_Size_mean</td>\n",
              "      <td>1.097291</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>95</th>\n",
              "      <td>Category_OS_Version_Required_Reviews_sum</td>\n",
              "      <td>1.063311</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>39</th>\n",
              "      <td>Offered_By_Size_sum</td>\n",
              "      <td>1.062960</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>38</th>\n",
              "      <td>Offered_By_Size_mean</td>\n",
              "      <td>1.031772</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>92</th>\n",
              "      <td>Category_OS_Version_Required_Rating_sum</td>\n",
              "      <td>1.018026</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>36</th>\n",
              "      <td>Offered_By_Size_min</td>\n",
              "      <td>0.989586</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>Last_Updated_On_year</td>\n",
              "      <td>0.949379</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>108</th>\n",
              "      <td>Category_Content_Rating_Price_mean</td>\n",
              "      <td>0.905001</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>105</th>\n",
              "      <td>Category_Content_Rating_Reviews_mean</td>\n",
              "      <td>0.901988</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>41</th>\n",
              "      <td>Offered_By_Price_max</td>\n",
              "      <td>0.848848</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>113</th>\n",
              "      <td>Category_Content_Rating_Size_sum</td>\n",
              "      <td>0.830453</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>102</th>\n",
              "      <td>Category_Content_Rating_Rating_mean</td>\n",
              "      <td>0.796290</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>53</th>\n",
              "      <td>OS_Version_Required_Size_max</td>\n",
              "      <td>0.785115</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>Category_Size_max</td>\n",
              "      <td>0.775380</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>98</th>\n",
              "      <td>Category_OS_Version_Required_Price_sum</td>\n",
              "      <td>0.769127</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>101</th>\n",
              "      <td>Category_OS_Version_Required_Size_sum</td>\n",
              "      <td>0.713012</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>30</th>\n",
              "      <td>Category_Rating_mean</td>\n",
              "      <td>0.692810</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>OS_Version_Required</td>\n",
              "      <td>0.683045</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>Category_Reviews_mean</td>\n",
              "      <td>0.644601</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>37</th>\n",
              "      <td>Offered_By_Size_max</td>\n",
              "      <td>0.591300</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>Category_Size_mean</td>\n",
              "      <td>0.569323</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>Category_Size_sum</td>\n",
              "      <td>0.564171</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>Category_Price_mean</td>\n",
              "      <td>0.562768</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>Category_Price_max</td>\n",
              "      <td>0.538810</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>103</th>\n",
              "      <td>Category_Content_Rating_Rating_count</td>\n",
              "      <td>0.526634</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>Category_Price_sum</td>\n",
              "      <td>0.521342</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>91</th>\n",
              "      <td>Category_OS_Version_Required_Rating_count</td>\n",
              "      <td>0.503785</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>54</th>\n",
              "      <td>OS_Version_Required_Size_mean</td>\n",
              "      <td>0.502382</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>88</th>\n",
              "      <td>Category_OS_Version_Required_count</td>\n",
              "      <td>0.483405</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>110</th>\n",
              "      <td>Category_Content_Rating_Price_sum</td>\n",
              "      <td>0.446886</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>Category_Reviews_max</td>\n",
              "      <td>0.446121</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>58</th>\n",
              "      <td>OS_Version_Required_Price_mean</td>\n",
              "      <td>0.417460</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>31</th>\n",
              "      <td>Category_Rating_sum</td>\n",
              "      <td>0.387087</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>81</th>\n",
              "      <td>Category_unique_count</td>\n",
              "      <td>0.356171</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>42</th>\n",
              "      <td>Offered_By_Price_mean</td>\n",
              "      <td>0.354190</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>Last_Updated_On_month</td>\n",
              "      <td>0.331196</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>62</th>\n",
              "      <td>OS_Version_Required_Rating_mean</td>\n",
              "      <td>0.306551</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>Price</td>\n",
              "      <td>0.286138</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>40</th>\n",
              "      <td>Offered_By_Price_min</td>\n",
              "      <td>0.261778</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>57</th>\n",
              "      <td>OS_Version_Required_Price_max</td>\n",
              "      <td>0.252645</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>104</th>\n",
              "      <td>Category_Content_Rating_Rating_sum</td>\n",
              "      <td>0.248570</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>43</th>\n",
              "      <td>Offered_By_Price_sum</td>\n",
              "      <td>0.241387</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>109</th>\n",
              "      <td>Category_Content_Rating_Price_count</td>\n",
              "      <td>0.237593</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>97</th>\n",
              "      <td>Category_OS_Version_Required_Price_count</td>\n",
              "      <td>0.234886</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>50</th>\n",
              "      <td>OS_Version_Required_Reviews_mean</td>\n",
              "      <td>0.231325</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>100</th>\n",
              "      <td>Category_OS_Version_Required_Size_count</td>\n",
              "      <td>0.222824</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>112</th>\n",
              "      <td>Category_Content_Rating_Size_count</td>\n",
              "      <td>0.219203</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>Category_Rating_min</td>\n",
              "      <td>0.219068</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>86</th>\n",
              "      <td>Category_Rating_nunique</td>\n",
              "      <td>0.201310</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>Content_Rating</td>\n",
              "      <td>0.170012</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>106</th>\n",
              "      <td>Category_Content_Rating_Reviews_count</td>\n",
              "      <td>0.167615</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>78</th>\n",
              "      <td>Content_Rating_Rating_mean</td>\n",
              "      <td>0.162389</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>94</th>\n",
              "      <td>Category_OS_Version_Required_Reviews_count</td>\n",
              "      <td>0.129446</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>Size Varies</td>\n",
              "      <td>0.129216</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>59</th>\n",
              "      <td>OS_Version_Required_Price_sum</td>\n",
              "      <td>0.127903</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>Last_Updated_On_quarter</td>\n",
              "      <td>0.113167</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>55</th>\n",
              "      <td>OS_Version_Required_Size_sum</td>\n",
              "      <td>0.106207</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>49</th>\n",
              "      <td>OS_Version_Required_Reviews_max</td>\n",
              "      <td>0.088550</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>74</th>\n",
              "      <td>Content_Rating_Price_mean</td>\n",
              "      <td>0.082641</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>69</th>\n",
              "      <td>Content_Rating_Size_max</td>\n",
              "      <td>0.082630</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>67</th>\n",
              "      <td>Content_Rating_Reviews_sum</td>\n",
              "      <td>0.078443</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>83</th>\n",
              "      <td>OS_Version_Required_unique_count</td>\n",
              "      <td>0.072560</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>66</th>\n",
              "      <td>Content_Rating_Reviews_mean</td>\n",
              "      <td>0.064676</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>87</th>\n",
              "      <td>OS_Version_Required_Rating_nunique</td>\n",
              "      <td>0.052410</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>80</th>\n",
              "      <td>Offered_By_unique_count</td>\n",
              "      <td>0.038941</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>Size in Mb</td>\n",
              "      <td>0.037739</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>79</th>\n",
              "      <td>Content_Rating_Rating_sum</td>\n",
              "      <td>0.036434</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>71</th>\n",
              "      <td>Content_Rating_Size_sum</td>\n",
              "      <td>0.035874</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>70</th>\n",
              "      <td>Content_Rating_Size_mean</td>\n",
              "      <td>0.034318</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>51</th>\n",
              "      <td>OS_Version_Required_Reviews_sum</td>\n",
              "      <td>0.029607</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>85</th>\n",
              "      <td>OS_Version_Required_Category_nunique</td>\n",
              "      <td>0.018616</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>60</th>\n",
              "      <td>OS_Version_Required_Rating_min</td>\n",
              "      <td>0.011521</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>75</th>\n",
              "      <td>Content_Rating_Price_sum</td>\n",
              "      <td>0.009065</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>65</th>\n",
              "      <td>Content_Rating_Reviews_max</td>\n",
              "      <td>0.006528</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>29</th>\n",
              "      <td>Category_Rating_max</td>\n",
              "      <td>0.004813</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>Category_Reviews_min</td>\n",
              "      <td>0.004002</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>73</th>\n",
              "      <td>Content_Rating_Price_max</td>\n",
              "      <td>0.002669</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>82</th>\n",
              "      <td>Content_Rating_unique_count</td>\n",
              "      <td>0.002205</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>63</th>\n",
              "      <td>OS_Version_Required_Rating_sum</td>\n",
              "      <td>0.000022</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>52</th>\n",
              "      <td>OS_Version_Required_Size_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>Size in Kb</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>89</th>\n",
              "      <td>Content_Rating_OS_Version_Required_count</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>48</th>\n",
              "      <td>OS_Version_Required_Reviews_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>Category_Size_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>84</th>\n",
              "      <td>Content_Rating_Category_nunique</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>56</th>\n",
              "      <td>OS_Version_Required_Price_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>77</th>\n",
              "      <td>Content_Rating_Rating_max</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>Category_Price_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>76</th>\n",
              "      <td>Content_Rating_Rating_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>72</th>\n",
              "      <td>Content_Rating_Price_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>68</th>\n",
              "      <td>Content_Rating_Size_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>64</th>\n",
              "      <td>Content_Rating_Reviews_min</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>61</th>\n",
              "      <td>OS_Version_Required_Rating_max</td>\n",
              "      <td>0.000000</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "                                        feature  Importance\n",
              "2                                       Reviews   14.685999\n",
              "10                           Reviews_per_rating   13.659587\n",
              "33                       Offered_By_Reviews_max    5.024228\n",
              "35                       Offered_By_Reviews_sum    4.746836\n",
              "32                       Offered_By_Reviews_min    4.434028\n",
              "34                      Offered_By_Reviews_mean    3.242454\n",
              "1                                        Rating    2.540379\n",
              "15                         Last_Updated_On_week    2.306738\n",
              "13                          Last_Updated_On_day    2.273866\n",
              "45                        Offered_By_Rating_max    1.973929\n",
              "44                        Offered_By_Rating_min    1.918678\n",
              "90     Category_OS_Version_Required_Rating_mean    1.726054\n",
              "46                       Offered_By_Rating_mean    1.540209\n",
              "96      Category_OS_Version_Required_Price_mean    1.532843\n",
              "99       Category_OS_Version_Required_Size_mean    1.460773\n",
              "0                                      Category    1.458660\n",
              "19                         Category_Reviews_sum    1.208632\n",
              "47                        Offered_By_Rating_sum    1.175228\n",
              "93    Category_OS_Version_Required_Reviews_mean    1.135189\n",
              "107         Category_Content_Rating_Reviews_sum    1.133419\n",
              "3                                          Size    1.097743\n",
              "111           Category_Content_Rating_Size_mean    1.097291\n",
              "95     Category_OS_Version_Required_Reviews_sum    1.063311\n",
              "39                          Offered_By_Size_sum    1.062960\n",
              "38                         Offered_By_Size_mean    1.031772\n",
              "92      Category_OS_Version_Required_Rating_sum    1.018026\n",
              "36                          Offered_By_Size_min    0.989586\n",
              "12                         Last_Updated_On_year    0.949379\n",
              "108          Category_Content_Rating_Price_mean    0.905001\n",
              "105        Category_Content_Rating_Reviews_mean    0.901988\n",
              "41                         Offered_By_Price_max    0.848848\n",
              "113            Category_Content_Rating_Size_sum    0.830453\n",
              "102         Category_Content_Rating_Rating_mean    0.796290\n",
              "53                 OS_Version_Required_Size_max    0.785115\n",
              "21                            Category_Size_max    0.775380\n",
              "98       Category_OS_Version_Required_Price_sum    0.769127\n",
              "101       Category_OS_Version_Required_Size_sum    0.713012\n",
              "30                         Category_Rating_mean    0.692810\n",
              "6                           OS_Version_Required    0.683045\n",
              "18                        Category_Reviews_mean    0.644601\n",
              "37                          Offered_By_Size_max    0.591300\n",
              "22                           Category_Size_mean    0.569323\n",
              "23                            Category_Size_sum    0.564171\n",
              "26                          Category_Price_mean    0.562768\n",
              "25                           Category_Price_max    0.538810\n",
              "103        Category_Content_Rating_Rating_count    0.526634\n",
              "27                           Category_Price_sum    0.521342\n",
              "91    Category_OS_Version_Required_Rating_count    0.503785\n",
              "54                OS_Version_Required_Size_mean    0.502382\n",
              "88           Category_OS_Version_Required_count    0.483405\n",
              "110           Category_Content_Rating_Price_sum    0.446886\n",
              "17                         Category_Reviews_max    0.446121\n",
              "58               OS_Version_Required_Price_mean    0.417460\n",
              "31                          Category_Rating_sum    0.387087\n",
              "81                        Category_unique_count    0.356171\n",
              "42                        Offered_By_Price_mean    0.354190\n",
              "11                        Last_Updated_On_month    0.331196\n",
              "62              OS_Version_Required_Rating_mean    0.306551\n",
              "4                                         Price    0.286138\n",
              "40                         Offered_By_Price_min    0.261778\n",
              "57                OS_Version_Required_Price_max    0.252645\n",
              "104          Category_Content_Rating_Rating_sum    0.248570\n",
              "43                         Offered_By_Price_sum    0.241387\n",
              "109         Category_Content_Rating_Price_count    0.237593\n",
              "97     Category_OS_Version_Required_Price_count    0.234886\n",
              "50             OS_Version_Required_Reviews_mean    0.231325\n",
              "100     Category_OS_Version_Required_Size_count    0.222824\n",
              "112          Category_Content_Rating_Size_count    0.219203\n",
              "28                          Category_Rating_min    0.219068\n",
              "86                      Category_Rating_nunique    0.201310\n",
              "5                                Content_Rating    0.170012\n",
              "106       Category_Content_Rating_Reviews_count    0.167615\n",
              "78                   Content_Rating_Rating_mean    0.162389\n",
              "94   Category_OS_Version_Required_Reviews_count    0.129446\n",
              "9                                   Size Varies    0.129216\n",
              "59                OS_Version_Required_Price_sum    0.127903\n",
              "14                      Last_Updated_On_quarter    0.113167\n",
              "55                 OS_Version_Required_Size_sum    0.106207\n",
              "49              OS_Version_Required_Reviews_max    0.088550\n",
              "74                    Content_Rating_Price_mean    0.082641\n",
              "69                      Content_Rating_Size_max    0.082630\n",
              "67                   Content_Rating_Reviews_sum    0.078443\n",
              "83             OS_Version_Required_unique_count    0.072560\n",
              "66                  Content_Rating_Reviews_mean    0.064676\n",
              "87           OS_Version_Required_Rating_nunique    0.052410\n",
              "80                      Offered_By_unique_count    0.038941\n",
              "7                                    Size in Mb    0.037739\n",
              "79                    Content_Rating_Rating_sum    0.036434\n",
              "71                      Content_Rating_Size_sum    0.035874\n",
              "70                     Content_Rating_Size_mean    0.034318\n",
              "51              OS_Version_Required_Reviews_sum    0.029607\n",
              "85         OS_Version_Required_Category_nunique    0.018616\n",
              "60               OS_Version_Required_Rating_min    0.011521\n",
              "75                     Content_Rating_Price_sum    0.009065\n",
              "65                   Content_Rating_Reviews_max    0.006528\n",
              "29                          Category_Rating_max    0.004813\n",
              "16                         Category_Reviews_min    0.004002\n",
              "73                     Content_Rating_Price_max    0.002669\n",
              "82                  Content_Rating_unique_count    0.002205\n",
              "63               OS_Version_Required_Rating_sum    0.000022\n",
              "52                 OS_Version_Required_Size_min    0.000000\n",
              "8                                    Size in Kb    0.000000\n",
              "89     Content_Rating_OS_Version_Required_count    0.000000\n",
              "48              OS_Version_Required_Reviews_min    0.000000\n",
              "20                            Category_Size_min    0.000000\n",
              "84              Content_Rating_Category_nunique    0.000000\n",
              "56                OS_Version_Required_Price_min    0.000000\n",
              "77                    Content_Rating_Rating_max    0.000000\n",
              "24                           Category_Price_min    0.000000\n",
              "76                    Content_Rating_Rating_min    0.000000\n",
              "72                     Content_Rating_Price_min    0.000000\n",
              "68                      Content_Rating_Size_min    0.000000\n",
              "64                   Content_Rating_Reviews_min    0.000000\n",
              "61               OS_Version_Required_Rating_max    0.000000"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 33
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "DyZDIcjfP3h4",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "output = pd.DataFrame(columns=list(range(0,18)))\n",
        "m = pd.concat(final_preds,axis=1)\n",
        "for i in range(0,18):\n",
        "  output[i] = m[i].mean(axis=1)\n",
        "\n",
        "output.to_csv(\"ensemble_KFOLD_submission_v5.csv\",index=False)"
      ],
      "execution_count": 47,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "2yKa2mOiUEW4",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 422
        },
        "outputId": "e839d98e-a7df-4935-e07b-30c3dab9e30e"
      },
      "source": [
        "# submission = testing_predictions(model)\n",
        "# # submission.to_csv(\"submission.csv\",index=False)\n",
        "# submission"
      ],
      "execution_count": 32,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>0</th>\n",
              "      <th>1</th>\n",
              "      <th>2</th>\n",
              "      <th>3</th>\n",
              "      <th>4</th>\n",
              "      <th>5</th>\n",
              "      <th>6</th>\n",
              "      <th>7</th>\n",
              "      <th>8</th>\n",
              "      <th>9</th>\n",
              "      <th>10</th>\n",
              "      <th>11</th>\n",
              "      <th>12</th>\n",
              "      <th>13</th>\n",
              "      <th>14</th>\n",
              "      <th>15</th>\n",
              "      <th>16</th>\n",
              "      <th>17</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>0.000350</td>\n",
              "      <td>0.012536</td>\n",
              "      <td>0.000007</td>\n",
              "      <td>0.000011</td>\n",
              "      <td>0.049784</td>\n",
              "      <td>0.000085</td>\n",
              "      <td>0.000037</td>\n",
              "      <td>0.695376</td>\n",
              "      <td>0.000028</td>\n",
              "      <td>0.000948</td>\n",
              "      <td>0.000203</td>\n",
              "      <td>0.000003</td>\n",
              "      <td>0.000015</td>\n",
              "      <td>0.179852</td>\n",
              "      <td>0.000016</td>\n",
              "      <td>0.000086</td>\n",
              "      <td>0.060653</td>\n",
              "      <td>0.000009</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>0.000105</td>\n",
              "      <td>0.132101</td>\n",
              "      <td>0.000145</td>\n",
              "      <td>0.000034</td>\n",
              "      <td>0.002751</td>\n",
              "      <td>0.002441</td>\n",
              "      <td>0.000028</td>\n",
              "      <td>0.432031</td>\n",
              "      <td>0.000865</td>\n",
              "      <td>0.000217</td>\n",
              "      <td>0.003947</td>\n",
              "      <td>0.000264</td>\n",
              "      <td>0.000017</td>\n",
              "      <td>0.037969</td>\n",
              "      <td>0.000379</td>\n",
              "      <td>0.000053</td>\n",
              "      <td>0.386491</td>\n",
              "      <td>0.000164</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>0.000009</td>\n",
              "      <td>0.093303</td>\n",
              "      <td>0.000603</td>\n",
              "      <td>0.000005</td>\n",
              "      <td>0.000026</td>\n",
              "      <td>0.568867</td>\n",
              "      <td>0.000003</td>\n",
              "      <td>0.000269</td>\n",
              "      <td>0.007929</td>\n",
              "      <td>0.000015</td>\n",
              "      <td>0.314438</td>\n",
              "      <td>0.000118</td>\n",
              "      <td>0.000004</td>\n",
              "      <td>0.000096</td>\n",
              "      <td>0.011527</td>\n",
              "      <td>0.000007</td>\n",
              "      <td>0.002185</td>\n",
              "      <td>0.000596</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>0.003219</td>\n",
              "      <td>0.005015</td>\n",
              "      <td>0.000030</td>\n",
              "      <td>0.000139</td>\n",
              "      <td>0.286640</td>\n",
              "      <td>0.000141</td>\n",
              "      <td>0.000226</td>\n",
              "      <td>0.517412</td>\n",
              "      <td>0.000041</td>\n",
              "      <td>0.008772</td>\n",
              "      <td>0.000327</td>\n",
              "      <td>0.000012</td>\n",
              "      <td>0.000271</td>\n",
              "      <td>0.151917</td>\n",
              "      <td>0.000051</td>\n",
              "      <td>0.000448</td>\n",
              "      <td>0.025322</td>\n",
              "      <td>0.000017</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>0.001259</td>\n",
              "      <td>0.018080</td>\n",
              "      <td>0.000010</td>\n",
              "      <td>0.000031</td>\n",
              "      <td>0.086414</td>\n",
              "      <td>0.000191</td>\n",
              "      <td>0.000093</td>\n",
              "      <td>0.631320</td>\n",
              "      <td>0.000121</td>\n",
              "      <td>0.001115</td>\n",
              "      <td>0.000525</td>\n",
              "      <td>0.000008</td>\n",
              "      <td>0.000053</td>\n",
              "      <td>0.202615</td>\n",
              "      <td>0.000087</td>\n",
              "      <td>0.000127</td>\n",
              "      <td>0.057919</td>\n",
              "      <td>0.000033</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24771</th>\n",
              "      <td>0.158359</td>\n",
              "      <td>0.002010</td>\n",
              "      <td>0.000024</td>\n",
              "      <td>0.000642</td>\n",
              "      <td>0.476704</td>\n",
              "      <td>0.000203</td>\n",
              "      <td>0.006564</td>\n",
              "      <td>0.019370</td>\n",
              "      <td>0.000064</td>\n",
              "      <td>0.283213</td>\n",
              "      <td>0.000317</td>\n",
              "      <td>0.000028</td>\n",
              "      <td>0.000481</td>\n",
              "      <td>0.032522</td>\n",
              "      <td>0.000068</td>\n",
              "      <td>0.012869</td>\n",
              "      <td>0.006541</td>\n",
              "      <td>0.000022</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24772</th>\n",
              "      <td>0.341662</td>\n",
              "      <td>0.000164</td>\n",
              "      <td>0.000012</td>\n",
              "      <td>0.059789</td>\n",
              "      <td>0.003734</td>\n",
              "      <td>0.000010</td>\n",
              "      <td>0.354355</td>\n",
              "      <td>0.000238</td>\n",
              "      <td>0.000015</td>\n",
              "      <td>0.027830</td>\n",
              "      <td>0.000011</td>\n",
              "      <td>0.000018</td>\n",
              "      <td>0.065167</td>\n",
              "      <td>0.000220</td>\n",
              "      <td>0.000011</td>\n",
              "      <td>0.146665</td>\n",
              "      <td>0.000087</td>\n",
              "      <td>0.000010</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24773</th>\n",
              "      <td>0.012183</td>\n",
              "      <td>0.001450</td>\n",
              "      <td>0.000008</td>\n",
              "      <td>0.000108</td>\n",
              "      <td>0.339806</td>\n",
              "      <td>0.000017</td>\n",
              "      <td>0.000648</td>\n",
              "      <td>0.365905</td>\n",
              "      <td>0.000017</td>\n",
              "      <td>0.026210</td>\n",
              "      <td>0.000058</td>\n",
              "      <td>0.000009</td>\n",
              "      <td>0.000092</td>\n",
              "      <td>0.243712</td>\n",
              "      <td>0.000018</td>\n",
              "      <td>0.001128</td>\n",
              "      <td>0.008619</td>\n",
              "      <td>0.000011</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24774</th>\n",
              "      <td>0.000019</td>\n",
              "      <td>0.061844</td>\n",
              "      <td>0.000109</td>\n",
              "      <td>0.000004</td>\n",
              "      <td>0.000092</td>\n",
              "      <td>0.730730</td>\n",
              "      <td>0.000010</td>\n",
              "      <td>0.000775</td>\n",
              "      <td>0.010274</td>\n",
              "      <td>0.000044</td>\n",
              "      <td>0.180218</td>\n",
              "      <td>0.000017</td>\n",
              "      <td>0.000007</td>\n",
              "      <td>0.000123</td>\n",
              "      <td>0.012693</td>\n",
              "      <td>0.000016</td>\n",
              "      <td>0.002204</td>\n",
              "      <td>0.000822</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24775</th>\n",
              "      <td>0.000286</td>\n",
              "      <td>0.017400</td>\n",
              "      <td>0.000016</td>\n",
              "      <td>0.000009</td>\n",
              "      <td>0.030445</td>\n",
              "      <td>0.000268</td>\n",
              "      <td>0.000022</td>\n",
              "      <td>0.736261</td>\n",
              "      <td>0.000099</td>\n",
              "      <td>0.000585</td>\n",
              "      <td>0.001145</td>\n",
              "      <td>0.000004</td>\n",
              "      <td>0.000015</td>\n",
              "      <td>0.114588</td>\n",
              "      <td>0.000100</td>\n",
              "      <td>0.000041</td>\n",
              "      <td>0.098690</td>\n",
              "      <td>0.000026</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>24776 rows × 18 columns</p>\n",
              "</div>"
            ],
            "text/plain": [
              "             0         1         2   ...        15        16        17\n",
              "0      0.000350  0.012536  0.000007  ...  0.000086  0.060653  0.000009\n",
              "1      0.000105  0.132101  0.000145  ...  0.000053  0.386491  0.000164\n",
              "2      0.000009  0.093303  0.000603  ...  0.000007  0.002185  0.000596\n",
              "3      0.003219  0.005015  0.000030  ...  0.000448  0.025322  0.000017\n",
              "4      0.001259  0.018080  0.000010  ...  0.000127  0.057919  0.000033\n",
              "...         ...       ...       ...  ...       ...       ...       ...\n",
              "24771  0.158359  0.002010  0.000024  ...  0.012869  0.006541  0.000022\n",
              "24772  0.341662  0.000164  0.000012  ...  0.146665  0.000087  0.000010\n",
              "24773  0.012183  0.001450  0.000008  ...  0.001128  0.008619  0.000011\n",
              "24774  0.000019  0.061844  0.000109  ...  0.000016  0.002204  0.000822\n",
              "24775  0.000286  0.017400  0.000016  ...  0.000041  0.098690  0.000026\n",
              "\n",
              "[24776 rows x 18 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 32
        }
      ]
    }
  ]
}